Fixes budgets/votes_spec

This commit is contained in:
kikito
2016-12-19 19:10:49 +01:00
parent be2543cf61
commit eb5291d8a6
3 changed files with 13 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
<% voting_allowed = true unless reason.presence == :not_voting_allowed %> <% voting_allowed = true unless reason.presence == :not_voting_allowed %>
<% user_voted_for = voted_for?(investment_votes, investment) %> <% user_voted_for = voted_for?(investment_votes, investment) %>
<div class="supports"> <div class="supports js-supports">
<span class="total-supports <%= 'no-button' unless voting_allowed || user_voted_for %>"> <span class="total-supports <%= 'no-button' unless voting_allowed || user_voted_for %>">
<%= t("budget.investments.investment.supports", count: investment.total_votes) %> <%= t("budget.investments.investment.supports", count: investment.total_votes) %>
@@ -27,7 +27,7 @@
</div> </div>
<% if reason.present? && !user_voted_for %> <% if reason.present? && !user_voted_for %>
<div class="no-supports-allowed" style='display:none' aria-hidden="false"> <div class="js-supports-not-allowed" style='display:none' aria-hidden="false">
<p> <p>
<%= t("votes.budget_investments.#{reason}", <%= t("votes.budget_investments.#{reason}",
verify_account: link_to(t("votes.verify_account"), verification_path), verify_account: link_to(t("votes.verify_account"), verification_path),

View File

@@ -599,6 +599,12 @@ en:
organization: Organisations are not permitted to vote organization: Organisations are not permitted to vote
unfeasible: Unfeasible investment projects can not be supported unfeasible: Unfeasible investment projects can not be supported
not_voting_allowed: Voting phase is closed not_voting_allowed: Voting phase is closed
budget_investments:
not_logged_in: You must %{signin} or %{signup} to continue.
not_verified: Only verified users can vote on proposals; %{verify_account}.
organization: Organisations are not permitted to vote
unfeasible: Unfeasible investment projects can not be supported
not_voting_allowed: Selecting phase is closed
welcome: welcome:
debates: debates:
description: For meeting, discussing and sharing the things that matter to us in our city. description: For meeting, discussing and sharing the things that matter to us in our city.

View File

@@ -94,16 +94,16 @@ feature 'Votes' do
visit budget_investments_path(budget, heading_id: heading.id) visit budget_investments_path(budget, heading_id: heading.id)
within("#budget_investment_#{investment.id}") do within("#budget_investment_#{investment.id}") do
find("div.supports").hover find("div.js-supports").hover
expect_message_selecting_not_allowed expect(page).to have_content 'No Selecting Allowed'
end end
visit budget_investment_path(budget, investment) visit budget_investment_path(budget, investment)
within("#budget_investment_#{investment.id}") do within("#budget_investment_#{investment.id}") do
find("div.supports").hover find("div.js-supports").hover
expect_message_selecting_not_allowed expect(page).to have_content 'No Selecting Allowed'
end end
end end
end end
end end