Commit Graph

11202 Commits

Author SHA1 Message Date
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
Raimond Garcia
a3a5971cbf Merge pull request #2696 from javierv/2573-fix_flaky_budgets_spec
Fix flaky spec: Admin budgets Manage groups and headings Create group
2018-07-12 16:04:06 +02:00
Raimond Garcia
eb13c83a95 Merge pull request #2695 from javierv/2446_and_2519-fix_flaky_emails_spec
Fix flaky specs: Emails Budgets Selected/Unselected investment
2018-07-12 16:02:28 +02:00
Raimond Garcia
00c7c0a5b5 Merge pull request #2758 from consul/sec-fix
Update Sprockets to fix vulnerability
2018-07-12 00:54:20 +02:00
Juanjo Bazán
17b139e141 updates sprockets
address vulnerability in sprockets CVE-2018-3760.  https://groups.google.com/forum/#!topic/ruby-security-ann/2S9Pwz2i16k
2018-07-11 19:03:33 +02:00
Alberto
c5c611837d Merge pull request #2732 from consul/legislation-help-gif
Legislation help gif
2018-07-11 17:44:12 +02:00
decabeza
5dd1cdf6d3 Adds missing i18n 2018-07-11 14:37:35 +02:00
decabeza
334e567d0d Adds generic annotator help gif 2018-07-11 14:37:27 +02:00
Alberto
b8396135e9 Merge pull request #2752 from consul/following-hidden-proposals
Deal gracefully with hidden followable in my activity
2018-07-10 18:44:34 +02:00
Alberto
d12769525c Merge pull request #2751 from consul/home-recommendations
Deal gracefully with recommendations of hidden proposals
2018-07-10 18:44:13 +02:00
rgarcia
b3978908b2 Use strings instead of method calls in expectations 2018-07-10 18:08:47 +02:00
rgarcia
90bb06e684 Fix display of unfeasibility explanation
We were missing a check to make sure valuation had finished before
displaying the unfeasibility explanation
2018-07-10 17:57: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
rgarcia
f670019325 Deal gracefully with recommendations of hidden proposals
We were seeing an exceptions in the home page when displaying
recommendations. This was due to trying to load tags of hidden proposals

With this commit we are skipping proposals that that have been hidden,
which will hopefully solve this exception
2018-07-10 17:47:28 +02:00
Raimond Garcia
f7f1f12b82 Merge pull request #2722 from arun1595/issue-template-#2635
Add issue template
2018-07-09 10:30:44 +02:00
Raimond Garcia
f700f33197 Merge pull request #2711 from javierv/fix_flaky_ckeditor_specs
Fix flaky specs using CKEditor
2018-07-09 10:28:55 +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
0cf799add6 Use dynamic times and dates in factories.
The tests depending on the date changing were still failing because
Date.current was being stubbed after loading the factories. The
following lines affected these specific tests:

factory :poll_officer_assignment, class: 'Poll::OfficerAssignment' do
(...)
  date Date.current
end

So if the tests were executed right before midnight, the sequence was:

1. The factories file was loaded, assigning Date.current to the date of
every Poll::OfficerAssignment to be created.
2. Time passed, so now it was after midnight.
3. The `travel_to` method freezed time, after midnight.
4. A Poll::OfficerAssignment factory was created, using the date it was
before midnight.

Using dynamic fixtures solves the problem:

factory :poll_officer_assignment, class: 'Poll::OfficerAssignment' do
(...)
  date { Date.current }
end

Now the sequence is:

1. The factories file is loaded, and since it finds a block, doesn't
assign a static value to every Poll::OfficerAssignment to be created.
2. Time passes, so now it's after midnight.
3. The `travel_to` method freezes time, after midnight.
4. A Poll::OfficerAssignment factory was created, and in executes the
block, using the current date, that is, after midnight.
2018-07-09 00:06:55 +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
Alberto
2c0c592a54 Merge pull request #2733 from consul/ui-design
UI design
2018-07-06 12:03:14 +02:00
decabeza
f213768035 Removes duplicated spec 2018-07-05 18:14:22 +02:00
decabeza
9ecb4f4f22 Fixes heading name on budgets index view 2018-07-05 18:14:15 +02:00
decabeza
2b958de992 Fixes valuation budget investments ui 2018-07-05 18:14:08 +02:00
decabeza
4d0a5838a6 Fixes lint warnig 2018-07-05 18:13:57 +02:00
decabeza
3dc469ad2d Adss image height to recommendations on homepage 2018-07-05 18:13:45 +02:00
decabeza
a6ce928bc6 Fixes images size on help pages 2018-07-05 18:13:38 +02:00
decabeza
6f4f161076 Adds help gif on legislation processes with texts 2018-07-05 18:10:06 +02:00
Alberto
95f66aefe6 Merge pull request #2726 from consul/officing-no-vote
Officing not to vote
2018-07-05 17:07:10 +02:00
decabeza
2f922e1adb Adds button to officing voters if person decided not to vote 2018-07-05 14:12:22 +02:00
Alberto
e201de6ac9 Merge pull request #2725 from consul/officer-shifts
Officing sidebar menu
2018-07-05 11:08:42 +02:00
Alberto
f7cbe32163 Merge pull request #2724 from consul/a11y
A11y
2018-07-05 11:08:16 +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
decabeza
8900b1ffce Shows flag actions div only if user can hide 2018-07-04 17:14:29 +02:00
decabeza
abf0fe992e Removes tablist and tab roles 2018-07-04 17:14:24 +02:00
Raúl Fuentes
85f3f06255 Delete unused key 2018-07-04 12:32:52 +02:00
Raúl Fuentes
275f9ad812 Added new test to budget/investment/index, tested the combination between text search and any other option in the search form 2018-07-04 11:55:13 +02:00
Raúl Fuentes
ee19c2fef0 Fixed test for updated form 2018-07-04 11:55:13 +02:00
Raúl Fuentes
df899cde6e Fixed html, now it reflects the current search also added serach by name or id to the Budget::Invesment search function 2018-07-04 11:55:13 +02:00
Raúl Fuentes
4cd2f11723 Fixed test for the refactored form 2018-07-04 11:55:13 +02:00
Raúl Fuentes
c9f31b8e1e Refactor Admin::Budget::Investment search form to use one form tag 2018-07-04 11:55:13 +02:00
Arun Kumar
e4d5307c06 Add issue template 2018-07-04 02:50:16 -05: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
Javier Martín
37eaf29517 Fix flaky emails spec.
These tests were failing randomly because there is no guarantee
the methods `Budget#email_selected` and `Budget#email_unselected` will
always send the emails in the same order, because `investments.selected`
and `investments.unselected` don't necessarily return the records in the
order they were created.

Ordering by id is certainly not very elegant; however, ordering by
another field like `created_at` is dangerous because the record could be
created at (almost) the exact same time.

Related to issue #2446 and issue #2519.
2018-07-03 23:59:20 +02:00
Angel Perez
4a6313fed7 Add missing thead & tbody tags on moderation index views 2018-07-03 09:22:42 -04:00
Angel Perez
452d7dd252 Fix page entries information and filter positioning 2018-07-03 09:22:42 -04: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
Alberto
ff4c72987f Merge pull request #2716 from consul/admin-booths-menu
Adds ballot booths menu on admin
2018-07-03 11:20:42 +02:00
Alberto
27374d9899 Merge pull request #2715 from consul/manager-ui
Manager UI
2018-07-03 11:20:21 +02:00