Commit Graph

1963 Commits

Author SHA1 Message Date
rgarcia
2366182689 Fix specs 2018-07-20 12:28:56 +02:00
rgarcia
4cd5bb90d4 Fix validation error when creating proposals without user verification
We were getting a validation error when skipping user verification and
creating proposals

This was due to the responsible_name being empty for unverified users

As skipping user verification is a temporary setting used until Census
integration is configured, we can safely skip this validation when this
setting is active
2018-07-20 11:53:01 +02:00
Angel Perez
463c753880 Recommendations are automatically disabled if dismissed by user 2018-07-15 21:28:58 -04:00
Angel Perez
0b7967440f Recommendations for users are enabled by default 2018-07-15 21:28:58 -04:00
Angel Perez
0ac6033ff6 Refactor recommendations specs to improve DRYness 2018-07-15 21:28:57 -04:00
Angel Perez
251441e109 Users can now hide recommendations 2018-07-15 21:28:57 -04:00
Angel Perez
4275069a1e Include tests for recommendations feature 2018-07-15 21:28:57 -04:00
decabeza
bdb3f30e40 Adds recommendations on proposals index 2018-07-15 21:28:57 -04:00
decabeza
36a5ff39b8 Adds recommendations on debates index 2018-07-15 21:28:57 -04:00
Raimond Garcia
0695c2038c Merge pull request #2734 from javierv/2713-fix_flaky_update_votes_spec
Fix flaky specs: Votes Debates and Voting comments Update
2018-07-15 14:35:18 +02:00
rgarcia
225166a5eb Remove focus from specs 2018-07-15 13:58:32 +02:00
Javier Martín
32504b8840 Make Capybara check the page between votes.
As pointed out in PR #2734:

"After clicking the first link, there's an AJAX request which replaces
the existing `.in-favor a` and `.against a` links with new elements. So
if Capybara tries to click the existing `.against a` link at the same
moment it's being replaced, clicking the link won't generate a new
request".

Making Capybara check the page for new content before clicking the
second link solves the problem, in the same way 4ddc869 solved the same
problem in the comments section.
2018-07-13 22:58:12 +02:00
Angel Perez
4ddc869441 Mitigate recurrent flaky specs for voting comments 2018-07-13 22:42:41 +02:00
decabeza
bbaec57c8a Adds message in budget investment show if project is winner 2018-07-13 18:37:16 +02:00
Angel Perez
306b6d8967 Fix failing admin/banners scenario 2018-07-12 10:17:25 -04:00
iagirre
0d9da5398b Fix banners in user pages
Banners were not been shown in certain pages; now
they are.

Spec to check if the banner is been shown correctly
added. Before it was in admins specs, now it has it's
own spec out of admins folder.
2018-07-12 10:17:25 -04:00
iagirre
5ce08532cb Update PR with master
Rebase master branch so that this PR can
be updated with the latest changes.
Conflicts has been solved. dev_seeds
has been also adapted to the new format
(it all separated to be easier to manage).
Some specs has been updated to work with
selenium-webkit.
2018-07-12 10:17:25 -04:00
iagirre
82cb8d4c52 Changes suggested in PR:
* Delete all things related to banner images and styles (in code)
* Add a new test to check that the banner is showing correctly
* Update the specs accordingly to match the changes

Update dev_seed to set a random background_color and a font_color for banners (and remove everything about image and style)
Add a rake task to migrate the banner style to backgroun_color and font_color (so that the banners have the same colors than before)
2018-07-12 10:17:24 -04:00
iagirre
bf69a7bba7 Specs added to test the change of background and font color with color-picker and text-field 2018-07-12 10:16:47 -04:00
Raimond Garcia
046b620848 Merge pull request #2712 from javierv/2520_and_2521-fix_flaky_results_specs
Fix flaky specs: Officing Results Add/Edit results
2018-07-12 16:06:30 +02:00
Raimond Garcia
06689d9cc6 Merge pull request #2697 from javierv/2558-fix_flay_spec_supporting_proposals
Fix flaky spec: Proposals Voting Voting proposals on behalf of someone in show view
2018-07-12 16:04:41 +02:00
rgarcia
88cde6d018 Deal gracefully with hidden followable in my activity
We were seeing an exception when a user was following a proposal and
that proposal becomes hidden

With this commit we are skipping this proposals and hopefully fixing
this exception

We are also adjusting the count of followed proposals, without
including hidden proposals. It might be cleaner, to remove a `Follow`
when its `Followable` becomes hidden. But then we should probably
activate the `Follow` again if the `Followable` becomes non-hidden…

For now this commit should suffice 😌
2018-07-10 17:50:51 +02:00
Javier Martín
735eab8e71 Avoid date changes during residence tests.
As it happened with results (commit 4a559ed), these tests failed if
`Date.current` changes between the moment records are created and the
moment the rest of the test is executed.
2018-07-09 00:17:15 +02:00
Javier Martín
de0afe1621 Don't monkey patch ActiveSupport.
It could have side effects (for example, a conflict after upgrading to
Rails 5).

Thanks @aitbw for the suggestion!
2018-07-09 00:06:55 +02:00
Javier Martín
4a559ed3cd Avoid date changes during results tests.
As explained by @iagirre with pinpoint accuracy [1]:

"If the officer_assignments are created at 23:59:59 and the rest of the
test is executed after 00:00:00, the dates for the objects and the
`Date.current` (used to check if there are any shifts today) won't be
the same, because the shift will be for, lets say, 07/03/2018 and
`Date.current` will be 08/03/2018, so, there are no shifts."

Freezing time avoids this issue.

Related to issues #2520 and #2521.

[1] https://github.com/AyuntamientoMadrid/consul/pull/1342
2018-07-09 00:06:55 +02:00
decabeza
f213768035 Removes duplicated spec 2018-07-05 18:14:22 +02: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
Javier Martín
b1996e5694 Check page between AJAX requests in proposals spec.
There was a flaky spec supporting proposals. It's hard to reproduce and
be sure about what was going on, so here is my best guess. Given the
code:

```
within(".proposals-list") { click_link proposal.title }
within("#proposal_#{proposal.id}_votes") { click_link('Support') }
```

The first clicked link generates an AJAX request. Usually, Capybara
would wait for the AJAX request to generate a "Support" link in the
element `#proposal_XX_votes`. However, there's already a
`#proposal_XX_votes` element with a "Support" link on the proposals
index page!

So Capybara doesn't have to wait for the AJAX request to finish before
clicking the "Support" link. From then on, anything can happen.

Another option that works:

```
within(".proposals-list") { click_link proposal.title }
within(".proposal-show #proposal_#{proposal.id}_votes") { click_link('Support') }
```

With this code, the link selector fails on the proposals index page, and
Capybara waits for the AJAX request to finish.

Related to issue #2558.
2018-07-04 00:00:51 +02:00
Alberto
1de0cf083f Merge pull request #2717 from consul/allow-author-notifications-to-be-moderated
Allow author notifications to be moderated
2018-07-03 11:21:26 +02:00
iagirre
894c5d1eca Fix restore notifications from admins page
The restore feature was not working properly. When pushed, the button
was removing the notification from the admins panel, but it was not
restoring in the proposal.

I added an `after_restore` function (that I missed in the first PR)
so that the notification is unmarked as moderated.
2018-07-02 18:19:49 +02:00
iagirre
8dadb228f1 Add specs to test the prop. notifications hide action
Specs that test if the proposal notifications hide action works.
It also tests if the admin part works (mark as reviewed, ignore them, etc.)
2018-07-02 18:18:05 +02:00
decabeza
b4b2688e08 Updates texts on specs 2018-07-02 17:41:53 +02:00
decabeza
d683a6cd6b Adds styles to budget investment milestone status and fixes spec 2018-06-27 19:28:43 +02:00
María Checa
fb5b993920 Add Budget::Investment::Statuses tests 2018-06-27 18:34:02 +02:00
María Checa
e8e9fcd0da Add Budget::Investment::Statuses tests 2018-06-27 16:45:58 +02: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
decabeza
56ee33d947 Removes content pending to backport 2018-06-08 19:46:07 +02:00
decabeza
55097ac643 Updates specs for show to valuators checkbox 2018-06-08 18:59:53 +02:00
decabeza
43b75b8356 Updates texts on admin legislation specs 2018-06-08 18:49:19 +02:00
decabeza
6ce6b548b0 Updates i18n texts on specs 2018-06-08 18:40:07 +02:00
decabeza
20cf51c0bd Updates texts on specs 2018-06-08 18:30:51 +02:00
Alberto
f9940980b0 Merge pull request #2645 from wairbut-m2c/admin-form-improvements-backport
Admin form improvements
2018-06-07 17:44:38 +02:00
Alberto
f345786cc0 Merge pull request #2622 from consul/selected-investments-map
Adds message to selected budget investments
2018-06-06 19:21:24 +02:00
decabeza
0bf31bde6c Updates all active to is-active classes 2018-06-06 12:02:13 +02:00
decabeza
ee884ed998 Updates active to is-active class for menus 2018-06-06 12:01:16 +02:00
Alberto
a05f6ac61a Merge pull request #2641 from consul/homepage
Add customization of homepage from admin section
2018-06-01 19:18:44 +02:00
Alberto
ec58ada817 Merge pull request #2650 from aamarill/2586-split_admin_settings
Split admin settings
2018-06-01 19:18:14 +02:00
decabeza
ef57396f9d Fixes styles for admin homepage 2018-06-01 18:00:19 +02:00