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

@@ -373,10 +373,8 @@ describe "Emails" do
scenario "Unfeasible investment" do
budget.update(phase: "valuating")
investment = create(:budget_investment, author: author, budget: budget)
valuator = create(:valuator)
investment.valuators << valuator
investment = create(:budget_investment, author: author, budget: budget, valuators: [valuator])
login_as(valuator.user)
visit edit_valuation_budget_budget_investment_path(budget, investment)