fixes specs

This commit is contained in:
rgarcia
2017-01-10 21:30:38 +01:00
parent 4d5b885b7e
commit 53c5ea7e90
11 changed files with 36 additions and 1 deletions

View File

@@ -290,6 +290,11 @@ describe SpendingProposal do
let(:city_sp) { create(:spending_proposal) }
let(:district_sp) { create(:spending_proposal, geozone: district) }
before(:each) do
Setting["feature.spending_proposals"] = true
Setting['feature.spending_proposal_features.voting_allowed'] = true
end
describe '#reason_for_not_being_votable_by' do
it "rejects not logged in users" do
expect(city_sp.reason_for_not_being_votable_by(nil)).to eq(:not_logged_in)
@@ -344,6 +349,9 @@ describe SpendingProposal do
describe "total votes" do
it "takes into account physical votes in addition to web votes" do
Setting["feature.spending_proposals"] = true
Setting['feature.spending_proposal_features.voting_allowed'] = true
sp = create(:spending_proposal)
sp.register_vote(create(:user, :level_two), true)
expect(sp.total_votes).to eq(1)