Commit Graph

22 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
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
Javi Martín
ae98dbf683 Use Rails 5.1 conventions in tests params 2019-08-07 15:50:00 +02:00
Senén Rodero Rodríguez
51cda51155 Add debates translation interface
Also fix broken spec after removing translatable attributes from
strong_parameters definition. Now we need to send these attributes
as nested translations attributes.

Use activerecord.yml title attribute label so form helper could load it
from default location.
2019-06-27 09:19:36 +02:00
Julian Herrero
6e88031537 Fix several rubocop warnings
Metrics/LineLength: Line is too long.
RSpec/InstanceVariable: Use let instead of an instance variable.
Layout/TrailingBlankLines: Final newline missing.
Style/StringLiterals: Prefer double-quoted strings.
2019-04-17 17:40:56 +02:00
rgarcia
9a49716f22 updates controller specs deprecation warnings 2019-04-17 17:40:55 +02:00
Julian Herrero
31ac8b7f55 Change single quotes to double quotes 2019-02-15 11:40:39 +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
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
ed16a78f42 Enables RSpec/ExampleWording and fixes all issues
Both avoiding 'should' and repiting 'it' on the tests description
improves reading them and also makes all descriptions consistent.

Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleWording
2018-01-07 01:03:45 +01:00
Bertocq
798b646135 Cleanup Settings values modified after specs are run 2017-06-07 20:55:42 +02:00
Juanjo Bazán
6b351de6a1 fixes build 2016-07-11 10:43:27 +02:00
Juanjo Bazán
8316d9d895 fixes spec 2016-07-10 23:24:42 +02:00
kikito
dea1a28a69 purges simple_captcha 2016-04-27 16:07:47 +02:00
Josep Jaume Rey Peroy
5de3d700e4 Simplify Settings API 2016-01-18 12:43:34 +01:00
kikito
2d3015703d replaces constants by class methods + private functions. Fixes broken tests 2015-09-10 13:02:21 +02:00
rgarcia
6a09e6548d reverts - stats with delayed jobs 2015-09-09 19:17:13 +02:00
rgarcia
e555126331 tracks debate visits from the controller 2015-09-09 14:41:19 +02:00
Juanjo Bazán
274ddb2589 changes rules for allowing debate votes
first 100 votes are allowed for unverified users
2015-09-02 13:40:38 +02:00
Juanjo Bazán
bbf96259fc adds controller check for anonymous votes 2015-09-01 17:49:02 +02:00
Juanjo Bazán
862a239d87 fixes specs and makes stats for admins eyes only 2015-08-17 22:00:54 +02:00
Eloy Gomez
b23ca8deb1 Create event on debate creation 2015-08-08 13:08:48 +02:00