Simplify creating voters in specs

This commit is contained in:
Javi Martín
2019-09-26 02:18:21 +02:00
parent 994b5c99c2
commit 818b442d52
21 changed files with 126 additions and 220 deletions

View File

@@ -637,9 +637,8 @@ describe "Proposals" do
end
scenario "Update should not be posible if proposal is not editable" do
proposal = create(:proposal)
Setting["max_votes_for_proposal_edit"] = 10
11.times { create(:vote, votable: proposal) }
Setting["max_votes_for_proposal_edit"] = 3
proposal = create(:proposal, voters: Array.new(4) { create(:user) })
expect(proposal).not_to be_editable