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
This commit is contained in:
Bertocq
2018-01-06 20:18:24 +01:00
parent 6555d20a6a
commit de2816a6a5
4 changed files with 32 additions and 39 deletions

View File

@@ -24,3 +24,6 @@ Metrics/LineLength:
Layout/IndentationConsistency:
EnforcedStyle: rails
RSpec/BeforeAfterAll:
Enabled: true