Cleanup Settings values modified after specs are run

This commit is contained in:
Bertocq
2017-05-30 00:55:53 +02:00
parent 16edbf15a2
commit 798b646135
23 changed files with 109 additions and 14 deletions

View File

@@ -138,11 +138,14 @@ describe Proposal do
Setting["proposal_code_prefix"] = "TEST"
proposal = create(:proposal)
expect(proposal.code).to eq "TEST-#{proposal.created_at.strftime('%Y-%m')}-#{proposal.id}"
Setting["proposal_code_prefix"] = "MAD"
end
describe "#editable?" do
let(:proposal) { create(:proposal) }
before(:each) {Setting["max_votes_for_proposal_edit"] = 5}
after(:each) {Setting["max_votes_for_proposal_edit"] = 1000}
it "should be true if proposal has no votes yet" do
expect(proposal.total_votes).to eq(0)