Commit Graph

98 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
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
decabeza
b4b2688e08 Updates texts on specs 2018-07-02 17:41:53 +02:00
iagirre
d84895b800 Add test suite for the feature
The tests that will check the featute
is working well added. There are four test:

1. Checks that the emails are been send to
the user. The test looks for the link in there
and takes the token. Visits the page and
changes the password.

2 and 3. Both change the password by hand. One
uses a password written by the manager, whilst
the other uses the 'Generate random password'
option. Both tests check that the user can
sign in with the new passwords.

4. Checks that the password can be printed
when it is saved.
2018-04-02 09:43:17 +02:00
Angel Perez
dfbf4b8489 Refactor spec to use let syntax to DRY scenarios 2018-03-27 14:47:51 -04:00
Angel Perez
122b17033b Use Selenium API to accept/dismiss JS modals/browser alerts
JS modals/browser alerts are not automatically accepted now with
Selenium, events that trigger such events must be wrapped in one
of the following methods: `accept_alert`, `accept_confirm` or
`dismiss_confirm`
2018-03-27 14:47:49 -04:00
Bertocq
e0abb86267 Update specs for new heading options naming rules
* Update budget heading order scenario to check new option name rules
* Update other scenarios that were expecting old heading naming convention
2018-01-24 14:15:10 +01:00
Raimond Garcia
a215c9c603 Merge pull request #2322 from consul/current_budget
Change concept of current budget to account for multiple budgets
2018-01-16 16:53:10 +01:00
rgarcia
01ef439053 Display only current budget to Managers printing investments
In the specs, some investment were missing a heading_id, thus creating
another unexpected budget

By explicitly setting the heading_id we can control better which
budgets are created in each test
2018-01-15 22:02:04 +01:00
BertoCQ
61f52b3483 Merge pull request #2293 from wairbut-m2c/aperez-fix-deprecation-warnings
Fix for test suite deprecations warnings
2018-01-15 18:23:42 +01:00
Bertocq
2f27a86034 Replace deprecated capybara only_path option for ignore_query 2018-01-11 00:07:56 +01:00
decabeza
3b6fa6cbb4 fixes specs 2018-01-10 11:36:33 +01:00
María Checa
d8a6bb0f91 Changed tests 2018-01-09 00:09:50 +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
c4aa2d7093 Enable RSpec/MessageExpectation cop & fix issues
There was 34 `allow` occurences and 17 `expect` occurences, so to be consistent `allow` form was chosen.

Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageExpectation
2018-01-07 16:36:18 +01:00
Bertocq
f6aed3f9f1 Enable RSpec/ExpectActual cop and fix all issues
Always use a variable and not a literal as `expect` argument

Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectActual
2018-01-07 01:55:38 +01:00
Bertocq
7f14544f71 Enable Capybara/CurrentPathExpectation cop & fix issues
Read cop description http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Capybara/CurrentPathExpectation to better understand reasons behind enforcing this rule

On some cases the `only_path: true` was needed as argument of `have_current_path` matcher to avoid comparing the url parameters and just checking the path.
2018-01-06 23:31:41 +01:00
Bertocq
22822aa173 Fix Style/RedundantParentheses rubocop issues 2017-09-25 22:44:58 +02:00
Angel Perez
2181a65bc2 Allow only YouTube/Vimeo URLs on 'video_url' attribute
Fixes #1841

On branch aperez-valid-video-url
  Changes to be committed:
    modified:   app/models/proposal.rb
    modified:   spec/factories.rb
    modified:   spec/models/proposal_spec.rb

Allow only YouTube/Vimeo URLs on 'video_url' attribute

Fixes #1841

On branch aperez-valid-video-url
  Changes to be committed:
    modified:   app/helpers/embed_videos_helper.rb
    modified:   app/models/proposal.rb
    modified:   spec/features/management/proposals_spec.rb
    modified:   spec/features/proposals_spec.rb
    modified:   spec/features/tags/proposals_spec.rb
    modified:   spec/models/proposal_spec.rb
2017-09-13 08:35:59 -04:00
Bertocq
ef81c277a0 Remove spending proposal specs, deprecated feature with flaky tests 2017-08-02 12:08:50 +02:00
Bertocq
3a54713ed0 Fix all Rails/DynamicFindBy rubocop issues 2017-07-10 23:04:27 +02:00
Bertocq
69f4e1c683 Fix all rubocop Metrics/LineLength issues (140+) 2017-07-10 13:22:49 +02:00
Bertocq
28970c6701 Fix all Style/UnneededInterpolation rubocop issues and remove from rubocop_tod 2017-07-04 22:44:08 +02:00
Bertocq
e6dd33bd66 Fix all Layout/SpaceAfterComma issues and remove from rubocop_todo list 2017-06-26 17:57:53 +02:00
Juanjo Bazán
315c57929a allows managers to create users without email
allows managers to create users without email

hides email preferences from account page for email-less users

prevents email delivery to users with no email

adds spec for user creation from management

adds specs for user's email requirement

adds spec for no deliveries if no email
2017-06-19 13:02:48 +02:00
decabeza
2e0b17afcf updates specs 2017-06-16 13:23:11 +02:00
Bertocq
798b646135 Cleanup Settings values modified after specs are run 2017-06-07 20:55:42 +02:00
Juanjo Bazán
6de0a45aa2 adds expectations for tag_list and organization_name fields 2017-05-19 12:38:28 +02:00
Juanjo Bazán
e922a11aa3 permits fields in management investment creation 2017-05-19 11:32:14 +02:00
Alberto Garcia Cabeza
dadfdba1b1 adds date of birth form when manager creates new user 2017-03-20 11:59:22 +01:00
rgarcia
170cb89a5c allows admins to see budgets in reviewing and selecting phase 2017-03-15 14:50:50 +01:00
rgarcia
17946b292b fixes specs 2017-01-13 16:37:39 +01:00
rgarcia
53c5ea7e90 fixes specs 2017-01-10 21:30:38 +01:00
Juanjo Bazán
e2118f701b removes hardcoded age, favours setting 2017-01-09 16:05:27 +01:00
Alberto Garcia Cabeza
d5ffabac55 fixes specs for management budget investments 2017-01-08 22:17:37 +01:00
kikito
9d97421b0e Merge branch 'master' into budgets 2016-12-27 14:02:12 +01:00
kikito
d8b2e703ca marks spec as pending 2016-12-27 13:15:22 +01:00
rgarcia
ddeca6f06d fixes specs 2016-12-23 19:05:25 +01:00
kikito
2e8650c324 merge with master 2016-12-12 16:09:05 +01:00
kikito
748fd8becf Makes all tests pass in bi management 2016-12-07 19:16:37 +01:00
Alberto Garcia Cabeza
7ef9bafbf9 fixes specs of remove link on debates and proposals description 2016-12-07 18:42:56 +01:00
kikito
b3be1633af Fixes all management bi issues except filtering by geozone 2016-12-07 16:35:27 +01:00
kikito
2760e751e7 fixes several specs 2016-12-06 20:09:17 +01:00
kikito
e793a0d8e1 Adapts management::budget_investments to new budgets 2016-12-06 18:05:58 +01:00
kikito
83fe74d530 Adds .js-class for specs 2016-12-05 17:33:20 +01:00
kikito
09539028a2 Replaces "search by district" by "search by heading". Fixes typo in spec 2016-12-05 11:27:04 +01:00
kikito
dee409cfc8 Fixes budget_helper issues 2016-12-02 20:10:42 +01:00
kikito
00cfb95913 Starts fixing management budget investments 2016-12-01 16:31:05 +01:00
kikito
13ffd73fee UNFINISHED budget management 2016-09-13 12:33:34 +02:00
kikito
2bc9e7be78 started working on budget manatement 2016-09-12 12:11:47 +02:00