Commit Graph

34 Commits

Author SHA1 Message Date
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
35bbd87093 Fix adding blank comments to existing annotations
We were using the `present?` method, which will always return true for a
comment object.
2019-10-23 04:28:08 +02:00
Javi Martín
78c6f6f7e9 Use the same key for "signin" and "signup" texts
We were using the same texts in several places
2019-10-05 14:07:23 +02:00
Javi Martín
a8903d80ce Remove instance variables in draft version spec
This one is a bit different than our usual scenario, since we create
three annotations and we only use two of them in the specs (because we
visit the path to that annotation). So there are probably better options
than the combination of `let!` and `before` I've chosen.
2019-09-30 16:43:10 +02:00
Javi Martín
91c21b0982 Remove instance variables in RSpec
Instance variables might lead to hard-to-detect issues, since using a
nonexistent instance variable will return `nil` instead of raising an
error.
2019-09-30 16:43:10 +02:00
Javi Martín
2522144ddf Remove useless assignments in draft versions specs
Now that we've moved the `draft_version` variable with `let`, these
variables can be removed without making it harder to read the code
vertically.
2019-09-30 15:23:52 +02:00
Javi Martín
297466fc80 Extract draft version variable to a let block
This way we can reuse the code (in some cases) and we can avoid instance
variables (in some other cases).
2019-09-30 15:23:52 +02:00
Javi Martín
f9ed186909 Add rubocop spacing rules
We were following these rules in most places; we just didn't define them
anywhere.
2019-09-10 21:04:56 +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
decabeza
a1bbc82c8d Changes allegations dates label 2018-09-20 17:33:04 +02:00
Angel Perez
38af45d450 Replace deprecated .trigger('click') API with .click 2018-03-27 14:47:49 -04: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
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
Bertocq
fa017b664f Enables RSpec/EmptyLineAfterFinalLet cop & fixes all issues
Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterFinalLet
2018-01-07 00:49:37 +01:00
Bertocq
69f4e1c683 Fix all rubocop Metrics/LineLength issues (140+) 2017-07-10 13:22:49 +02:00
decabeza
a97130934a fixes text on publish comment button 2017-06-28 13:40:37 +02:00
Bertocq
f6fe9cc7d2 Fix all Layout/SpaceAroundOperators rubocop issues and remove file list from rubocop_todo list 2017-06-26 18:04:20 +02:00
Bertocq
6c975998c5 Increase darft version feature spec scenario to expect comments visible 2017-06-21 02:54:00 +02:00
rgarcia
792b15b224 Merges annotations 2017-06-07 14:58:34 +02:00
rgarcia
f66102abdc fixes specs 2017-06-07 10:32:25 +02:00
Amaia Castro
b298fb7316 Show annotation context in annotation page
Only works with quotes within the same html node for now
2017-02-10 15:35:42 +01:00
Amaia Castro
47b35a8149 Add spec for publishing a comment from the comments box for a draft 2017-01-20 11:42:14 +01:00
Fernando Blat
819c9efcc3 Fix and complete feature specs 2017-01-14 17:19:27 +01:00
Amaia Castro
a56898fed7 Fix version chooser for annotations page 2017-01-11 23:11:11 +01:00
Amaia Castro
306e3fa59f Don’t show comments panel if seeing final version 2017-01-11 23:11:11 +01:00
Amaia Castro
1966c5b8fd Use mouse over event in spec 2017-01-10 18:30:30 +01:00
Amaia Castro
329b288c01 Try to fix poltergeist error in spec 2017-01-10 17:56:35 +01:00
Amaia Castro
b8f034d896 Legislation annotations/comments page 2017-01-09 09:29:15 +01:00
Amaia Castro
ee9fa3db15 Base Legislation Annotations 2017-01-04 12:56:58 +01:00
Amaia Castro
375602d297 Display title with an * when status is draft in version chooser 2017-01-04 12:15:12 +01:00
Amaia Castro
6d99a24740 Fix draft versions list 2017-01-04 10:13:55 +01:00
Amaia Castro
f040759693 Show only published draft versions to users (and also drafts to admins) 2017-01-03 22:08:54 +01:00
Amaia Castro
d2b3a21182 Fix abilities and add specs 2017-01-03 17:48:21 +01:00