Merge pull request #2009 from consul/votable_by_fix

Fixed already-answered logic
This commit is contained in:
Raimond Garcia
2017-10-07 18:21:05 +02:00
committed by GitHub
2 changed files with 4 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
<% poll_group.each do |poll| %>
<div class="poll with-image">
<% if user_signed_in? && !poll.votable_by?(current_user) %>
<% if user_signed_in? && !current_user.unverified? && !poll.votable_by?(current_user) %>
<div class="icon-poll-answer already-answer" title="<%= t("polls.index.already_answer") %>">
<span class="show-for-sr"><%= t("polls.index.already_answer") %></span>
</div>

View File

@@ -94,6 +94,9 @@ feature 'Polls' do
end
scenario 'Level 1 users' do
visit polls_path
expect(page).to_not have_selector('.already-answer')
poll.update(geozone_restricted: true)
poll.geozones << geozone