Enable RSpec/ScatteredSetup & fix issue

Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ScatteredSetup
This commit is contained in:
Bertocq
2018-01-07 17:52:29 +01:00
parent f8fb32db76
commit 3762fd347e
2 changed files with 7 additions and 2 deletions

View File

@@ -168,3 +168,6 @@ RSpec/ReturnFromStub:
RSpec/ScatteredLet:
Enabled: true
RSpec/ScatteredSetup:
Enabled: true

View File

@@ -10,8 +10,10 @@ describe Abilities::Valuator do
let(:assigned_investment) { create(:budget_investment, budget: create(:budget, phase: 'valuating')) }
let(:finished_assigned_investment) { create(:budget_investment, budget: create(:budget, phase: 'finished')) }
before { assigned_investment.valuators << valuator }
before { finished_assigned_investment.valuators << valuator }
before do
assigned_investment.valuators << valuator
finished_assigned_investment.valuators << valuator
end
it { should be_able_to(:read, SpendingProposal) }
it { should be_able_to(:update, SpendingProposal) }