Commit Graph

29 Commits

Author SHA1 Message Date
Javi Martín
7b0771106e Remove isolated useless assignments
These variables are not surrounded by other assignments, and so they can
safely be removed without making it harder to read the code vertically.
2019-09-25 12:43:44 +02:00
Javi Martín
5cbd160f11 Move login_as after creating data for a test
It doesn't really affect the tests, but it helps isolate useless
assignments, and we already did it this way 94% of the time.
2019-09-25 12:43:44 +02:00
Javi Martín
24aa4744f1 Simplify login for officer user in tests
The same way it's done in other places. We also remove a useless
assignment.
2019-09-25 12:43:44 +02:00
Javi Martín
320b7550ed Simplify assigning poll to a booth in specs
We were creating booth assignments explicitely, but we can use the
`has_many :through` relationship to make the code easier to read.
2019-09-25 12:38:37 +02:00
Javi Martín
12cdbf6196 Simplify assigning officer to a poll in specs
While it could be argued we're hiding the real way we've defined
associations in our models, the tests are so much easier to read when we
don't have so many lines just creating data.

Furthermore, developers who care about vertically aligning the code will
be glad to see some variables disrupting this alignment are now gone.
2019-09-25 12:38:37 +02:00
Javi Martín
52e54363ae Add trait to create a poll associated to a budget 2019-09-24 21:34:06 +02:00
Javi Martín
fe5b45ed18 Remove unnecessary poll creating assignments
The factory creating assignments automatically assigns a poll to it, so
we don't use the poll for anything else, there's no need to explicitely
create it.
2019-09-24 19:48:22 +02:00
Javi Martín
c8c8a7bc30 Simplify investment creation in specs
Now factories define default headings for investments, so there's no
need to create a group and a heading to create an investment.

Likewise, in order to create a heading it isn't necessary to specify a
group anymore; specifying the budget is enough.

It's possible that there are more similar cases we haven't simplified
yet; I'm only addressing the obvious ones.
2019-09-23 16:51:30 +02:00
Javi Martín
c05b9c2aac Apply Capybara/CurrentPathExpectation rubocop rule 2019-09-10 21:43:39 +02:00
Javi Martín
488461b8ac Remove consecutive blank lines 2019-09-10 20:02:15 +02:00
voodoorai2000
875ae1f487 Add spec for translated budget poll name
This spec fails if we remove the attribute `name` from `poll_params` in
the `Admin::Poll::PollsController`, which we would usually remove
because it's a translatable attribute.
2019-06-27 09:21: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
María Checa
394177213c Adds Ballot Sheet model and business logic 2019-04-10 16:04:39 +02:00
María Checa
ccf8d3a8e2 Adds ballot sheets controller and main views 2019-04-10 16:03:47 +02:00
decabeza
7bd0f9c1d7 Adds spec to do not show questions section on budget poll 2019-04-03 22:28:19 +02:00
rgarcia
431c313487 Use scenario instead of it in feature specs 2019-04-03 22:23:27 +02:00
rgarcia
6fa7562181 Automatically create a budget poll if it does not exist 2019-04-03 22:23:22 +02:00
rgarcia
8cfcfcb6a7 Check for link to poll in specs 2019-04-03 22:22:56 +02:00
rgarcia
b1b88918f0 Moving spec to budget_polls folder 2019-04-03 22:22:50 +02:00
María Checa
22727a9876 Hides budget polls in polls public index 2019-04-03 22:22:45 +02:00
María Checa
acb0a6070e Hides budget polls in polls admin index 2019-04-03 22:20:10 +02:00
rgarcia
7dd314c699 Do not display polls associated to a budget in admin poll questions
This section is used to select to which poll a question belongs to.

Budget polls are not meant to include questions that come from Citizen
Proposals or Government Questions, thus we do not display them
2019-04-03 22:20:01 +02:00
Bertocq
dac0264b63 Prevent offline budget vote after voting online 2019-04-03 22:19:56 +02:00
rgarcia
aa7441271d Prevent balloting online after casting a ballot offline 2019-04-03 22:19:51 +02:00
Bertocq
d3660d1245 Create Budget Poll offline/online vote feature test 2019-04-03 22:18:55 +02:00
decabeza
18e57b9662 Hides sibebar menu if officer has no shifts 2019-03-28 15:50:34 +01:00
Julian Herrero
31ac8b7f55 Change single quotes to double quotes 2019-02-15 11:40:39 +01:00
decabeza
21f3d39c6a Removes poll budget creation on specs 2018-07-04 18:12:43 +02:00
decabeza
16ff5c4400 Hides sidebar menus if officer has no shifts assigned 2018-07-04 17:22:03 +02:00