Merge pull request #3685 from consul/less_records_in_tests
Create less headings in budget investment tests
This commit is contained in:
@@ -83,7 +83,8 @@ FactoryBot.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" }
|
||||||
heading { association :budget_heading, budget: budget }
|
heading { budget&.headings&.reload&.sample || association(:budget_heading, budget: budget) }
|
||||||
|
|
||||||
association :author, factory: :user
|
association :author, factory: :user
|
||||||
description { "Spend money on this" }
|
description { "Spend money on this" }
|
||||||
price { 10 }
|
price { 10 }
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ describe Budget::Stats do
|
|||||||
|
|
||||||
it "doesn't count nil user ids" do
|
it "doesn't count nil user ids" do
|
||||||
create(:budget_ballot_line, investment: investment,
|
create(:budget_ballot_line, investment: investment,
|
||||||
ballot: create(:budget_ballot, budget: budget, user: nil, physical: true)
|
ballot: create(:budget_ballot, budget: budget.reload, user: nil, physical: true)
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(stats.total_participants_vote_phase).to be 0
|
expect(stats.total_participants_vote_phase).to be 0
|
||||||
|
|||||||
Reference in New Issue
Block a user