simplifies factories now that we have denormalization in investment and ballot lines

This commit is contained in:
kikito
2016-12-15 18:18:31 +01:00
parent 355e286608
commit 366a3e7552

View File

@@ -227,9 +227,7 @@ FactoryGirl.define do
factory :budget_investment, class: 'Budget::Investment' do factory :budget_investment, class: 'Budget::Investment' do
sequence(:title) { |n| "Budget Investment #{n} title" } sequence(:title) { |n| "Budget Investment #{n} title" }
budget association :heading, factory: :budget_heading
group { create :budget_group, budget: budget }
heading { create :budget_heading, group: group }
association :author, factory: :user association :author, factory: :user
description 'Spend money on this' description 'Spend money on this'
price 10 price 10
@@ -261,11 +259,8 @@ FactoryGirl.define do
end end
factory :budget_ballot_line, class: 'Budget::Ballot::Line' do factory :budget_ballot_line, class: 'Budget::Ballot::Line' do
budget association :ballot, factory: :budget_ballot
ballot { create :budget_ballot, budget: budget } association :investment, factory: :budget_investment
group { create :budget_group, budget: budget }
heading { create :budget_heading, group: group }
investment { create :budget_investment, :feasible, heading: heading }
end end
factory :vote do factory :vote do