Commit Graph

43 Commits

Author SHA1 Message Date
Javi Martín
aac23ea596 Use a block to travel in time in specs
If we don't use a block, if the spec fails the `travel_back` method
isn't executed.
2019-10-24 19:24:22 +02:00
Javi Martín
db97f9d08c Add and apply rubocop rules for empty lines
We were very inconsistent regarding these rules.

Personally I prefer no empty lines around blocks, clases, etc... as
recommended by the Ruby style guide [1], and they're the default values
in rubocop, so those are the settings I'm applying.

The exception is the `private` access modifier, since we were leaving
empty lines around it most of the time. That's the default rubocop rule
as well. Personally I don't have a strong preference about this one.


[1] https://rubystyle.guide/#empty-lines-around-bodies
2019-10-24 17:11:47 +02:00
Javi Martín
70a07c095f Add and apply Style/BlockDelimiters rubocop rule
We were already using it most of the time, but there were a few places
were we used brackets for multiline blocks.
2019-10-05 14:44:14 +02:00
Javi Martín
5ff1162038 Simplify creating follows in specs
While in theory we wouldn't need to use the `transient` nor the
`after(:create)` because there's already a `has_many :through`
association with followers, Factory Bot / ActiveRecord don't
automatically associate the followable, resulting in an invalid record
exception.
2019-09-30 13:34:31 +02:00
Javi Martín
818b442d52 Simplify creating voters in specs 2019-09-30 00:36:40 +02:00
Javi Martín
087b4bf2a6 Remove unused variables 2019-09-29 22:31:13 +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
7db32b337b Remove unnecessary author variables in specs
The factories creating proposals and debates automatically create an
author.
2019-09-24 19:50:14 +02:00
Javi Martín
da121ebc53 Remove redundant setting resets in after blocks
Settings are stored in the database, and so any changes to the settings
done during the tests are automatically rolled back between one test and
the next one.

There were also a few places where we weren't using an `after` block but
changing the setting at the end of the test.
2019-09-23 13:47:45 +02:00
decabeza
4c5b2723f4 Create new messages section for proposal's dashboard 2019-05-31 11:42:15 +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
decabeza
f06cdc5fbb Change my activity menu to my content 2019-05-17 17:47:40 +02:00
decabeza
eda6ea7f12 Merge branch 'master' into dashboard 2019-03-26 16:45:48 +01:00
Julian Herrero
31ac8b7f55 Change single quotes to double quotes 2019-02-15 11:40:39 +01:00
Julian Herrero
ab1e9a9310 Fix typo 2019-01-14 18:48:31 +01:00
Julian Herrero
2331cd048e Add pending specs for proposal notifications limits 2019-01-14 18:48:16 +01:00
Julian Herrero
c413497094 add missing spec 2018-12-03 17:12:47 +01:00
decabeza
c8f49644ce Fixes english translations 2018-11-08 12:07:13 +01:00
Juan Salvador Pérez García
26d2a500ef Fixes #204
Send message to the community has been moved outside of dashboard.
2018-07-17 17:59:11 +02:00
Juan Salvador Pérez García
921d567110 Implements #175
General menu has been refactored to look like the mockups.
The progress menu has been refactored as well.
2018-07-17 17:57:30 +02:00
Juan Salvador Pérez García
a2e185c221 Fixed proposal notification specs 2018-07-17 17:57:30 +02:00
Juan Salvador Pérez García
a05e5c003f Fixed failing tests 2018-07-17 17:50:46 +02: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
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
rgarcia
2b52d26d82 refactors notifications into concerns and shared examples 2017-12-14 16:15:30 +01:00
Senén Rodero Rodríguez
bb4e4dc084 Fix almost all broken specs 2017-08-01 16:28:01 +02:00
BertoCQ
204ea13c85 Merge branch 'master' into followable 2017-07-11 11:30:49 +02:00
Bertocq
69f4e1c683 Fix all rubocop Metrics/LineLength issues (140+) 2017-07-10 13:22:49 +02:00
taitus
e54e33f296 Use display in followable shared specs names when referring to DOM elements renderization. Add whitespace to proposal page. 2017-07-07 13:38:53 +02:00
taitus
b29bf62f56 Send proposals notifications to followers. 2017-07-07 13:37:55 +02:00
rgarcia
9d9bf488fc does not create notifications for blocked or erased users 2016-08-02 20:52:20 +02:00
rgarcia
18dd9c95f3 fixes specs 2016-06-16 12:06:26 +02:00
rgarcia
28d12fe55b removes sending individual proposal notifications via email 2016-06-15 10:43:02 +02:00
rgarcia
6e800c5120 adds email digest for proposal notifications 2016-06-14 17:53:36 +02:00
rgarcia
0e86cd89d6 adds permissions with cancan for new, create and show 2016-06-08 13:46:17 +02:00
rgarcia
16f10e34ef fixes specs 2016-06-07 23:17:00 +02:00
rgarcia
8e12fbdd55 adds time limit between notifications 2016-06-07 13:48:09 +02:00
rgarcia
a2c9756c18 displays message about receivers 2016-06-06 16:50:00 +02:00
rgarcia
86f0cae7bb fixes specs 2016-06-06 13:52:40 +02:00
rgarcia
fc6cc090f8 displays notifications in proposal view 2016-06-06 12:21:48 +02:00
rgarcia
ca26b3423b sends notification email to each voter 2016-06-01 21:40:23 +02:00
rgarcia
6e4ed0b895 adds link to send message from my activity 2016-06-01 21:01:24 +02:00
rgarcia
f5375e813d stores a proposal notification 2016-06-01 17:23:56 +02:00