Commit Graph

16 Commits

Author SHA1 Message Date
Javi Martín
7ca55c44e0 Apply Rails/SaveBang rubocop rule
Having exceptions is better than having silent bugs.

There are a few methods I've kept the same way they were.

The `RelatedContentScore#score_with_opposite` method is a bit peculiar:
it creates scores for both itself and the opposite related content,
which means the opposite related content will try to create the same
scores as well.

We've already got a test to check `Budget::Ballot#add_investment` when
creating a line fails ("Edge case voting a non-elegible investment").

Finally, the method `User#send_oauth_confirmation_instructions` doesn't
update the record when the email address isn't already present, leading
to the test "Try to register with the email of an already existing user,
when an unconfirmed email was provided by oauth" fo fail if we raise an
exception for an invalid user. That's because updating a user's email
doesn't update the database automatically, but instead a confirmation
email is sent.

There are also a few false positives for classes which don't have bang
methods (like the GraphQL classes) or destroying attachments.

For these reasons, I'm adding the rule with a "Refactor" severity,
meaning it's a rule we can break if necessary.
2019-10-23 14:39:31 +02:00
Javi Martín
e3a2c0c3a9 Use let in valuator group
This way we can remove a useless assignment without making the code
harder to read vertically.
2019-09-30 15:23:52 +02:00
Javi Martín
9ad5d82e9d Fix typos to make tests more robust
Apparently we forgot to use the variables which meant the tests weren't
testing exactly what they were supposed to test.
2019-09-29 22:31:14 +02:00
Javi Martín
7b0771106e Remove isolated useless assignments
These variables are not surrounded by other assignments, and so they can
safely be removed without making it harder to read the code vertically.
2019-09-25 12:43:44 +02:00
lalo
c2860dda0e Add can_comment and can_edit_dossier abilities to valuators 2019-06-11 16:24:02 +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
31ac8b7f55 Change single quotes to double quotes 2019-02-15 11:40:39 +01:00
voodoorai2000
7917cea676 Change to_not for not_to
Eventhough some of us sentimentals still like the syntax `to_not` the current trend is to move to the new syntax `not_to`.

In this commit we are updating the references of expectations that used `to_not` to `not_to`.
2018-12-15 12:33:28 +01:00
rgarcia
00c965b715 Clean up 2018-04-04 13:19:01 +02:00
rgarcia
2d3c4e1fbd Add group member count 2018-04-03 20:58:35 +02:00
rgarcia
fcb377c9e5 Remove description when creating valuator from index 2018-04-03 20:56:31 +02:00
rgarcia
bb82d533a3 Display valuators on valuator group's show 2018-04-03 20:56:31 +02:00
decabeza
6c68e9f8e7 Fixes specs 2018-04-03 20:56:31 +02:00
rgarcia
ab498d6d93 Assign groups to investments 2018-04-03 20:55:44 +02:00
rgarcia
1dbbe331c9 Assign valuators to groups 2018-04-03 20:55:44 +02:00
rgarcia
cddfdf4b84 Add valuator groups 2018-04-03 20:55:44 +02:00