Commit Graph

110 Commits

Author SHA1 Message Date
Bertocq
fc88e1ef79 Enable rubocop Bundler cops without issues 2018-02-10 21:03:38 +01:00
Bertocq
5de51b5f3c Enable rubocop Performance/Caller cop without issues 2018-02-10 20:59:20 +01:00
Bertocq
9abbf874f2 Enable rubocop-rspec RSpec/InstanceVariable cop 2018-02-10 19:34:30 +01:00
Bertocq
4ca0a48df6 Reduce rubocop's Metrics/LineLength max to 100 chars by common agreement 2018-01-08 19:11:04 +01:00
Bertocq
4fc03fe395 Enable RSpec/VoidExpect cop without issues 2018-01-07 18:48:59 +01:00
Bertocq
830bb37189 Enable RSpec/VerifiedDoubles cop, fix issues & stash one
Can't figureout solution for offense at spec/models/verification/management/email_spec.rb
 so its stashed at .rubocop_todo.yml

Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VerifiedDoubles
2018-01-07 18:47:19 +01:00
Bertocq
95e86eafbb Enable RSpec/SubjectStub cop without issues 2018-01-07 18:46:58 +01:00
Bertocq
425404b890 Enable RSpec/SingleArgumentMessageChain cop without issues 2018-01-07 18:46:58 +01:00
Bertocq
dc1deee15a Enable RSpec/SharedContext cop without issues 2018-01-07 18:46:58 +01:00
Bertocq
3762fd347e Enable RSpec/ScatteredSetup & fix issue
Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ScatteredSetup
2018-01-07 18:46:58 +01:00
Bertocq
f8fb32db76 Enable RSpec/ScatteredLet cop & fix issue
Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ScatteredLet
2018-01-07 18:46:58 +01:00
Bertocq
33365479c9 Enable RSpec/ReturnFromStub cop without issues 2018-01-07 18:46:58 +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
4f6597b200 Enable RSpec/RepeatedDescription cop & fix all issues
Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedDescription
2018-01-07 17:45:34 +01:00
Bertocq
e89d081a47 Enable RSpec/PredicateMatcher cop & fix all issues
Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/PredicateMatcher
2018-01-07 17:42:59 +01:00
Bertocq
c6cac965dd Enable RSpec/OverwritingSetup cop without issues 2018-01-07 17:40:59 +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
79a3b97c64 Enable RSpec/NestedGroups cop with a reasonable max value of 4 2018-01-07 17:38:55 +01:00
Bertocq
4c48027228 Explicitly disable RSpec/NamedSubject cop until debate is held 2018-01-07 17:36:46 +01:00
Bertocq
317247103e Enable RSpec/MultipleSubjects without issues 2018-01-07 17:07:34 +01:00
Bertocq
ce395217f8 Disable RSpec/MultipleExpectations cop with 1339 possible offenses, need to stablish a max amount after a debate 2018-01-07 17:06:43 +01:00
Bertocq
18d14dfe17 Enable RSpec/MultipleDescribes cop without issues 2018-01-07 17:04:38 +01:00
Bertocq
eb822c4a5e Enable RSpec/MessageSpies cop without issues
EnforcedStyle: receive configuration was added to follow codebase conventions

Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageSpies
2018-01-07 16:51:11 +01:00
Bertocq
c4aa2d7093 Enable RSpec/MessageExpectation cop & fix issues
There was 34 `allow` occurences and 17 `expect` occurences, so to be consistent `allow` form was chosen.

Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageExpectation
2018-01-07 16:36:18 +01:00
Bertocq
987b31d618 Enable RSpec/MessageChain cop without issues 2018-01-07 16:28:37 +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
3e5b13ae4d Enable RSpec/LetBeforeExamples cop & fix issues
Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LetBeforeExamples
2018-01-07 02:28:06 +01:00
Bertocq
4bb75c3a11 Enable RSpec/LeadingSubject cop without issues 2018-01-07 02:26:40 +01:00
Bertocq
eaf66e3ec1 Enable RSpec/IteratedExpectation cop and fix issues
Suggested refactor is only available for `.to` and not for `.not_to` :(

Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IteratedExpectation
2018-01-07 02:24:24 +01:00
Bertocq
77e6e33d35 Enable RSpec/ItBehavesLike cop without issues 2018-01-07 02:20:34 +01:00
Bertocq
54cd57de9b Enable RSpec/InvalidPredicateMatcher without issues 2018-01-07 02:19:23 +01:00
Bertocq
473e3d6466 Disable RSpec/InstanceVariable as we have 868 offenses for it 2018-01-07 02:15:43 +01:00
Bertocq
bf75b50b2f Enable RSpec/InstanceSpy cop without issues 2018-01-07 02:14:04 +01:00
Bertocq
ae04a76221 Enable RSpec/ImplicitExpect cop with convention
Used `EnforcedStyle: should` config as there is no `is_expected.to` usage on the codebase.

Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ImplicitExpect
2018-01-07 02:11:51 +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
39b01b6342 Enable RSpec/Focus cop without issues 2018-01-07 02:07:02 +01:00
Bertocq
95733f52f2 Enable RSpec/FilePath cop and fix all issues
Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FilePath
2018-01-07 02:05:10 +01:00
Bertocq
0f37239ac3 Enable Expect In Hook and Output rubocop rspec cops 2018-01-07 02:04:43 +01:00
Bertocq
f6aed3f9f1 Enable RSpec/ExpectActual cop and fix all issues
Always use a variable and not a literal as `expect` argument

Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectActual
2018-01-07 01:55:38 +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
971f2e308a Disables example length rubocop rspec cop, metrics always hard to meet 2018-01-07 00:53:08 +01:00
Bertocq
2253155a51 Enables RSpec/EmptyLineAfterSubject & fixes all issues
Read more about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterSubject
2018-01-07 00:50:50 +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
265d4d0967 Enables RSpec/DescribedClass cop & fixes all issues
Autocorrection for existing issues, and stashing at .rubocop_todo.yml
the false positives

Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribedClass
2018-01-07 00:38:19 +01:00
Bertocq
0c3dc56650 Enable both DescribeMethod and DescribeSymbol cops, without issues 2018-01-07 00:20:55 +01:00
Bertocq
6ec6f64675 Enable RSpec/DescribeClass rubocop rspec cop & fix issues
Manually fixes all issues & "stashed" false positives at .rubocop_todo.yml

Read about the cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribeClass
2018-01-07 00:20:55 +01:00
Bertocq
61be1015dd Explicitly disable rubocop-rspec cops until we can debate about it 2018-01-07 00:20:55 +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
Bertocq
4c7b2fcaa0 Update rubocop config with some rspec cops rules without issues 2018-01-06 21:19:03 +01:00
Bertocq
de2816a6a5 Enable RSpec/BeforeAfterAll rule and fix all issues
This cop tries to avoid state leaking between examples. The fixes done on the code don't follow the suggested path, since the usage of `before(:all)` was not really useful. By using RSpec's `let` method we achieve same goals but with much better and readable tests.

Check Cop description at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeforeAfterAll
2018-01-06 21:16:00 +01:00