Commit Graph

78 Commits

Author SHA1 Message Date
Javi Martín
a9159e0ec8 Directly assign valuators in specs
Creating a record and then assigning an association makes the code even
harder to follow.
2019-09-30 15:08:27 +02:00
Javi Martín
1973c61552 Simplify creating notifications in specs 2019-09-30 14:10:46 +02:00
Javi Martín
818b442d52 Simplify creating voters in specs 2019-09-30 00:36:40 +02:00
Javi Martín
eecc027fd3 Remove useless notification in emails spec
The `create_proposal_notification` method won't create a new
notification when a proposal has no supporters, so in the test
`notification3` was actually the same as `notification2`, related to
`proposal2`.
2019-09-29 22:52:53 +02:00
Javi Martín
49f81c9488 Add trait to create users with proposal and debate 2019-09-24 21:34:06 +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
2ec176a2a8 Remove redundant feature settings enabled in tests
These settings are enabled by default.

It could be argued explicitely enabling the features makes tests more
consistent, because they'll work if we change the default setting. It
could also be argued that it makes tests more expressive because it
makes the reader realize certain things will only work if a setting is
enabled.

However, we were only doing so in a few tests. The truth is, thousands
of our tests depend on certain features being enabled. So IMHO we should
be consistent and either set them on every test, or not at all. I'm
choosing the latter option for simplicity.
2019-09-23 15:15:51 +02:00
Senén Rodero Rodríguez
5eb5f02cbe Fix budget investment specs
After adding investment translatable fields to forms, they will be
generated with nested translations names and ids so we can no longer
use standard id locator.

Using input label text to fill in fields works with both types of forms.
2019-06-27 09:20:24 +02:00
voodoorai2000
d0b8fef6b3 Delete spending proposals 2019-05-31 18:22:59 +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
31ac8b7f55 Change single quotes to double quotes 2019-02-15 11:40:39 +01:00
Julian Herrero
24a3289fa8 Add spec for Staging email recipients 2019-01-31 17:49:09 +01:00
decabeza
c8f49644ce Fixes english translations 2018-11-08 12:07:13 +01:00
Angel Perez
84b616256f Fix spec to properly check emails are sent based on current locale 2018-09-10 11:45:13 -04:00
Angel Perez
08755524ef Replace I18n calls with explicit text expectations 2018-09-10 11:44:00 -04:00
Angel Perez
fa9da9d573 Usage of let on emails specs to DRY scenarios 2018-09-10 11:41:25 -04:00
decabeza
d80e7f9864 Updates emails specs 2018-07-30 19:35:21 +02:00
María Checa
b7a1599fdf Adds logic to send proposal notifications in batches
WIP batches tests
2018-07-26 17:55:06 +02:00
Bertocq
ac9f85e208 Change Proposal Notification Digest link to anchor
On the proposal notification digest messages there was a link to each
notification. Instead we need that link to point towards the notifications
tab of the proposal.
2018-07-25 20:20:33 +02:00
decabeza
6ce6b548b0 Updates i18n texts on specs 2018-06-08 18:40:07 +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
iagirre
e21588ec16 The function comment_on has been modified to change the functionality. Now, a comment is generated and a email notification send manually, so that JS has been avoided, that was the original problem. 2018-03-02 13:35:50 +01:00
María Checa
3867c6b716 Fixed newsletter tests 2018-02-28 17:02:39 +01:00
María Checa
24bca36639 Merge branch 'master' into admin-newsletter-emails 2018-02-14 16:07:13 +01:00
María Checa
e8c797766a Added newsletter specs 2018-02-14 16:06:33 +01:00
iagirre
80f97b3ca6 The flaky test has been modified completely to test the functionality described. JS has been avoided because it was one of the problems involved and it wasn't completely necessary. 2018-02-08 14:47:10 +01: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
María Checa
4d97d349a1 Added tests for alert 2018-01-17 19:11:48 +01:00
María Checa
5161988844 Removed external_url input 2018-01-08 23:22:46 +01:00
Bertocq
16eae689f9 Enable RSpec/RepeatedExample cop & fix all issues
Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExample
2018-01-07 18:46:32 +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
2d355ce938 Enable RSpec/LetSetup cop & fix issues
Read more about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LetSetup
2018-01-07 16:23:49 +01:00
Bertocq
1441de5107 Enable RSpec/HookArgument cop and fix issues
To be consistent about before/after arguments, as `:each` or `:example`
 are same and default scopes, best not to send an argument in those
 scenarios.

Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/HookArgument
2018-01-07 02:07:19 +01:00
Angel Perez
2bdc2c27d7 Add email specs for Poll 2017-11-17 13:14:03 -04:00
Angel Perez
4c110e8100 Add email specs for Topic 2017-11-17 13:14:03 -04:00
Angel Perez
3605a43947 Add email specs for Budget::Investment 2017-11-17 13:14:03 -04:00
Bertocq
ce0a7f6fad Rubocop autocorrections 2017-10-17 22:00:00 +02:00
rgarcia
89f81bf7a4 fixes exception when sending email about comment reply 2017-10-10 16:01:20 +02:00
Bertocq
ca35c8b85c Fix Style/NestedParenthesizedCalls rubocop issues 2017-09-25 22:47:59 +02:00
decabeza
dd0452ece6 updates texts on specs 2017-09-01 13:18:56 +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
Bertocq
798b646135 Cleanup Settings values modified after specs are run 2017-06-07 20:55:42 +02:00
rgarcia
712e576e75 adds email delivery of selected and unselected investments 2017-05-12 13:57:31 +02:00
Alberto Garcia Cabeza
9741ee859a updates i18n and specs 2017-01-15 14:02:08 +01:00
rgarcia
7aba8ef299 adds specs 2017-01-14 17:02:45 +01:00
rgarcia
11a8086599 adds specs 2017-01-14 16:12:45 +01:00
rgarcia
53c5ea7e90 fixes specs 2017-01-10 21:30:38 +01:00
rgarcia
5bd7fdb263 fixes specs 2016-08-03 20:05:08 +02:00
rgarcia
99b9c3867e adds pending spec 2016-08-02 20:52:08 +02:00