Directly assign valuators in specs

Creating a record and then assigning an association makes the code even
harder to follow.
This commit is contained in:
Javi Martín
2019-09-21 16:57:38 +02:00
parent 3ecab8af13
commit a9159e0ec8
7 changed files with 43 additions and 89 deletions

View File

@@ -5,10 +5,9 @@ describe "Internal valuation comments on Budget::Investments" do
let(:valuator_user) { create(:valuator).user }
let(:admin_user) { create(:administrator).user }
let(:budget) { create(:budget, :valuating) }
let(:investment) { create(:budget_investment, budget: budget) }
let(:investment) { create(:budget_investment, budget: budget, valuators: [valuator_user.valuator]) }
before do
investment.valuators << valuator_user.valuator
login_as(valuator_user)
end