displays alert for conflictive debates

This commit is contained in:
rgarcia
2015-09-07 17:16:57 +02:00
parent 4ce95e2735
commit f11220206a
2 changed files with 16 additions and 5 deletions

View File

@@ -13,11 +13,11 @@
<% end %>
<h1><%= @debate.title %></h1>
<!-- SI HAY 1 DENUNCIA POR CADA 5 VOTOS POSITIVOS MUESTRA ESTE MENSAJE -->
<div class="alert-box alert radius margin-top">
<strong><%= t("debates.show.flag") %></strong>
</div>
<!-- /. SI HAY 1 DENUNCIA POR CADA 5 VOTOS POSITIVOS MUESTRA ESTE MENSAJE -->
<% if @debate.conflictive? %>
<div class="alert-box alert radius margin-top">
<strong><%= t("debates.show.flag") %></strong>
</div>
<% end %>
<div class="debate-info">
<%= avatar_image(@debate.author, seed: @debate.author_id, size: 32, class: 'author-photo') %>

View File

@@ -453,4 +453,15 @@ feature 'Debates' do
expect(page).to_not have_content(debate3.title)
end
end
scenario 'Conflictive' do
good_debate = create(:debate)
conflictive_debate = create(:debate, :conflictive)
visit debate_path(conflictive_debate)
expect(page).to have_content "This debate has been flag as innapropiate for some users."
visit debate_path(good_debate)
expect(page).to_not have_content "This debate has been flag as innapropiate for some users."
end
end