Directly assign valuator groups in specs

This commit is contained in:
Javi Martín
2019-09-21 17:39:50 +02:00
parent 05f63ca08d
commit c6808c9c12
5 changed files with 11 additions and 26 deletions

View File

@@ -34,13 +34,10 @@ describe Valuator do
group = create(:valuator_group)
valuator = create(:valuator, valuator_group: group)
investment1 = create(:budget_investment)
investment2 = create(:budget_investment)
investment1 = create(:budget_investment, valuator_groups: [group])
investment2 = create(:budget_investment, valuator_groups: [group])
investment3 = create(:budget_investment)
investment1.valuator_groups << group
investment2.valuator_groups << group
assigned_investment_ids = valuator.assigned_investment_ids
expect(assigned_investment_ids).to match_array [investment1.id, investment2.id]