removes physical votes from proposals

This commit is contained in:
rgarcia
2016-12-29 12:05:29 +01:00
parent ff1dc631f1
commit 365faeff31
3 changed files with 6 additions and 6 deletions

View File

@@ -99,7 +99,7 @@ class Proposal < ActiveRecord::Base
end end
def total_votes def total_votes
cached_votes_up + physical_votes cached_votes_up
end end
def voters def voters

View File

@@ -0,0 +1,5 @@
class RemovePhysicalVotesFromProposals < ActiveRecord::Migration
def change
remove_column :proposals, :physical_votes
end
end

View File

@@ -13,11 +13,6 @@ describe ProposalsHelper do
expect(progress_bar_percentage(proposal)).to eq 50 expect(progress_bar_percentage(proposal)).to eq 50
end end
it "should take into account the physical votes" do
proposal = create(:proposal, cached_votes_up: ((Proposal.votes_needed_for_success/2)-100), physical_votes: 100)
expect(progress_bar_percentage(proposal)).to eq 50
end
it "should be 100 if there are more votes than needed" do it "should be 100 if there are more votes than needed" do
proposal = create(:proposal, cached_votes_up: Proposal.votes_needed_for_success*2) proposal = create(:proposal, cached_votes_up: Proposal.votes_needed_for_success*2)
expect(progress_bar_percentage(proposal)).to eq 100 expect(progress_bar_percentage(proposal)).to eq 100