Commit Graph

58 Commits

Author SHA1 Message Date
Julian Herrero
b122302c58 Use find instead of find_by_id
Better raise a 404 HTML NotFound exception than any other unexpected error.
2019-06-03 17:54:19 +02:00
Javi Martín
307cf24846 Use describe on feature tests
The `type: :feature` is automatically detected by RSpec because these
tests are inside the `spec/features` folder. Using `feature` re-adds a
`type: :feature` to these files, which will result in a conflict when we
upgrade to Rails 5.1's system tests.

Because of this change, we also need to change `background` to `before`
or else these tests will fail.
2019-05-28 16:36:54 +02:00
Julian Herrero
c82b2a975a Add new settings tab for participation processes
- Rename setting keys
- New tab por participation processes
- Hide these settings from features tab
2019-03-19 19:45:32 +01:00
Julian Herrero
8ae80cd1a1 Cleanup (remove unnecessary code) 2019-03-19 15:11:50 +01:00
Julian Herrero
31ac8b7f55 Change single quotes to double quotes 2019-02-15 11:40:39 +01:00
Javi Martín
fd681c17df Fix crash in valuation when there are no budgets 2018-12-21 17:24:34 +01:00
Bertocq
4329fab627 Group Index scenarios at Valuation Investments spec
Grouping scenarios makes it easier to follow the spec and to know where
to put a new scenario
2018-06-27 14:34:28 +02:00
Bertocq
3e75bd4dfd Fix Valuation Investment index heading filters
Why:

Heading filter where not being correctly displayed

How:

Increasing scenario to cover all possible combinations, and fixing the
heading_filters method of the Valuation Budget Investment Controller to
correctly:
  * Find how many investments the valuator can access
  * Count investments for each heading
2018-06-27 14:30:09 +02:00
iagirre
21a6d3495a Update PR with master
Rebase master branch so that this PR can
be updated with the latest changes.
Conflicts has been solved and some specs
updated to fit the new changes. dev_seeds
has been also adapted to the new format.
2018-04-09 16:11:06 +02:00
iagirre
b8cc10d218 Fix conflics after rebase 2018-04-09 15:02:35 +02:00
Bertocq
09fb4701b8 Fix Valuation Investment index heading filters
Why:

Heading filter where not being correctly displayed

How:

Increasing scenario to cover all possible combinations, and fixing the
heading_filters method of the Valuation Budget Investment Controller to
correctly:
  * Find how many investments the valuator can access
  * Count investments for each heading
2018-04-06 00:42:36 +02:00
Bertocq
c0986c7bfb Fix investment creation for single budget usage
Budget Investment factory creates a secondary budget as a collateral
effect because it has a Heading factory that has a Group factory that
creates a Budget.

This was resulting in problems due to having two "active" Budgets created
and `current_budget` method not choosing the one that we expected
2018-03-12 23:06:32 +01:00
Bertocq
8fd6f8f1d6 Valuators access to edit/valute on right phase
When a valuator tries to edit/valuate an investment outside valuating
phase, an explanatory message will be shown along with a redirect to
prevent access.
2018-03-12 20:22:53 +01:00
Bertocq
0516bc3e91 Prevent valuators from editing finished valuation
Valuators should not be able to edit a finished valuation (only admins
should).

The valuation form is only shown to the valuator if he has that ability
(we've previously modified app/models/abilities/valuator.rb to be able
to rely on `valuate` over an investment to check that)

If the valuator can't see the form, we present him just the data in
plain text.
2018-03-06 20:18:05 +01:00
Bertocq
a92ef57bf8 Make valuator spec 100 LineLength compliant
Readability of the code is important
2018-03-06 20:17:40 +01:00
Bertocq
7145ce5e5a Refactor Valuator spec Show context with lets
Extract duplicated code used to set the scenario conditions to simple
lets (admin, second valuator and investment)
2018-03-06 20:17:39 +01:00
Bertocq
400b3b1201 Swap @investment instance variable for a let
Why:

Avoid instance variables as we agreed upon with RSpec/InstanceVariable

How:

Using a let(:invsetment) and replacing all `@investment` with
`investment`, as well as adding a let(:admin) for the administrator.
2018-03-06 20:17:39 +01:00
Bertocq
9abf9bd87d Swap @budget instance variable for a let
Why:

Avoid instance variables as we agreed upon with RSpec/InstanceVariable

How:

Using a let(:budget) and replacing all `@budget` with `budget`
2018-03-06 20:17:38 +01:00
Bertocq
0a066f6bb6 Swap @valuator instance variable for a let
Why:

Avoid instance variables as we agreed upon with RSpec/InstanceVariable

How:

Using a let(:valuator) and replacing all `@valuator` with `valuator`
2018-03-06 20:17:37 +01:00
BertoCQ
05a6406189 Merge branch 'master' into remove_investments_internal_comments 2018-01-31 13:47:15 +01:00
Bertocq
345d513342 Remove unnecesary feature flag setting at spec 2018-01-30 12:13:01 +01:00
Bertocq
d280c254c8 Remove usage of Investment's internal_comments attr 2018-01-29 21:15:28 +01:00
María Checa
4d97d349a1 Added tests for alert 2018-01-17 19:11:48 +01:00
Bertocq
a2b950d8de Fix to_not to not_to on rspec expectations 2018-01-17 00:03:23 +01:00
rgarcia
5086314bee Display only current budget for Valuators
Before we could have multiple current budgets, as we now only have one
current_budget, some specs broke.

As there is no need to display multiple budgets to Valuators, only the
current budget is necessary, we can remove arrays and assume that only
a single budget, the current budget, is displayed to Valuators
2018-01-15 22:02:04 +01:00
Bertocq
34bb9d65b1 Enable RSpec/NotToNot cop and fix all issues
Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NotToNot
2018-01-07 17:39:48 +01:00
Bertocq
ca35c8b85c Fix Style/NestedParenthesizedCalls rubocop issues 2017-09-25 22:47:59 +02:00
Bertocq
ef81c277a0 Remove spending proposal specs, deprecated feature with flaky tests 2017-08-02 12:08:50 +02:00
Bertocq
775da2d581 Remove all Layout/EmptyLines issues on code and file list from rubocop_todo 2017-06-28 14:12:51 +02:00
Bertocq
f6fe9cc7d2 Fix all Layout/SpaceAroundOperators rubocop issues and remove file list from rubocop_todo list 2017-06-26 18:04:20 +02:00
Bertocq
e6dd33bd66 Fix all Layout/SpaceAfterComma issues and remove from rubocop_todo list 2017-06-26 17:57:53 +02:00
Bertocq
798b646135 Cleanup Settings values modified after specs are run 2017-06-07 20:55:42 +02:00
rgarcia
551421a621 removes poltergeist no js_errors driver 2017-05-04 01:48:17 +02:00
Alberto
6bbcc71ecb Merge branch 'master' into polls 2017-04-06 14:16:49 +02:00
rgarcia
386f935cc6 displays link to valuation section 2017-03-24 15:29:20 +01:00
rgarcia
c74587d921 fixes specs 2017-01-29 14:13:24 +01:00
rgarcia
53c5ea7e90 fixes specs 2017-01-10 21:30:38 +01:00
kikito
9e2afeb503 removes deprecated spec (valuators are not shown in valuation table) 2017-01-05 11:26:46 +01:00
Alberto Garcia Cabeza
a42c1387cf fixes specs 2017-01-04 19:38:49 +01:00
kikito
e9acf295b8 removes filter specs after removing filtering from valuation 2017-01-04 17:00:56 +01:00
kikito
98e9e8de0f Fixes errors in specs related to changes in budget phases 2017-01-02 10:37:37 +01:00
kikito
5b56336941 Fixes valuation features 2016-12-13 15:51:58 +01:00
Juanjo Bazán
42c705e1e3 adds dossier editing of investments to valuation 2016-09-09 15:09:06 +02:00
Juanjo Bazán
0fc31b1259 adds budget/budget_investment indexes to valuators 2016-09-09 13:39:08 +02:00
Juanjo Bazán
5f08d65152 fixes spec 2016-04-28 18:43:22 +02:00
rgarcia
aaca99b46f orders valuators by spending proposal count 2016-04-26 23:33:19 +02:00
rgarcia
463880f8fb fixes typo 2016-04-26 22:20:11 +02:00
rgarcia
4bbd3d7233 adds summary of spending proposals by valuator 2016-04-26 22:06:02 +02:00
Juanjo Bazán
3087b2dac9 changes default order in valuation/sps to votes up 2016-04-11 16:12:03 +02:00
kikito
d03864adb2 replaces the select in the valuators index with a list of links + pending count 2016-04-07 10:49:58 +02:00