removes possibility of taking away support for proposals
This commit is contained in:
@@ -75,10 +75,7 @@ class Proposal < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def register_vote(user, vote_value)
|
||||
return unless votable_by?(user)
|
||||
if user.voted_for?(self)
|
||||
unvote_by(user)
|
||||
else
|
||||
if votable_by?(user)
|
||||
vote_by(voter: user, vote: vote_value)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -452,20 +452,6 @@ feature 'Votes' do
|
||||
end
|
||||
end
|
||||
|
||||
scenario 'Update', :js do
|
||||
visit proposal_path(@proposal)
|
||||
|
||||
within('.supports') do
|
||||
find('.in-favor a').click
|
||||
expect(page).to have_content "1 support"
|
||||
expect(page).to have_css("a.voted")
|
||||
|
||||
find('.in-favor a').click
|
||||
expect(page).to have_content "No supports"
|
||||
expect(page).to_not have_css("a.no-voted")
|
||||
end
|
||||
end
|
||||
|
||||
scenario 'Trying to vote multiple times', :js do
|
||||
visit proposal_path(@proposal)
|
||||
|
||||
@@ -484,7 +470,7 @@ feature 'Votes' do
|
||||
visit proposal_path(@proposal)
|
||||
|
||||
within('.supports') do
|
||||
expect(page).to have_content "2 supports / 53.726"
|
||||
expect(page).to have_content "2 supports"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -569,5 +555,5 @@ feature 'Votes' do
|
||||
end
|
||||
end
|
||||
|
||||
xscenario "Remove support button text - tested in Update spec"
|
||||
xscenario "Change button text after voting"
|
||||
end
|
||||
Reference in New Issue
Block a user