removes physical votes from proposals
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
class RemovePhysicalVotesFromProposals < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
remove_column :proposals, :physical_votes
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user