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

@@ -167,4 +167,7 @@ RSpec/ReturnFromStub:
Enabled: true Enabled: true
RSpec/ScatteredLet: RSpec/ScatteredLet:
Enabled: true
RSpec/ScatteredSetup:
Enabled: true Enabled: true

View File

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