Merge pull request #3154 from consul/backport-check_for_deleted_proposals
[Backport] checks for deleted proposals
This commit is contained in:
@@ -31,7 +31,13 @@
|
|||||||
<td>
|
<td>
|
||||||
<h3>
|
<h3>
|
||||||
<%= notification.title %>
|
<%= notification.title %>
|
||||||
<small><%= link_to notification.proposal.title, proposal_path(notification.proposal) %></small>
|
<small>
|
||||||
|
<% if notification.proposal.present? %>
|
||||||
|
<%= link_to notification.proposal.title, proposal_path(notification.proposal) %>
|
||||||
|
<% else %>
|
||||||
|
<%= t("admin.stats.proposal_notifications.not_available") %><br>
|
||||||
|
<% end %>
|
||||||
|
</small>
|
||||||
</h3>
|
</h3>
|
||||||
<p><%= notification.body %></p>
|
<p><%= notification.body %></p>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -1304,6 +1304,7 @@ en:
|
|||||||
title: Proposal notifications
|
title: Proposal notifications
|
||||||
total: Total
|
total: Total
|
||||||
proposals_with_notifications: Proposals with notifications
|
proposals_with_notifications: Proposals with notifications
|
||||||
|
not_available: "Proposal not available"
|
||||||
polls:
|
polls:
|
||||||
title: Poll Stats
|
title: Poll Stats
|
||||||
all: Polls
|
all: Polls
|
||||||
|
|||||||
@@ -1303,6 +1303,7 @@ es:
|
|||||||
title: Notificaciones de propuestas
|
title: Notificaciones de propuestas
|
||||||
total: Total
|
total: Total
|
||||||
proposals_with_notifications: Propuestas con notificaciones
|
proposals_with_notifications: Propuestas con notificaciones
|
||||||
|
not_available: "Esta propuesta ya no está disponible"
|
||||||
polls:
|
polls:
|
||||||
title: Estadísticas de votaciones
|
title: Estadísticas de votaciones
|
||||||
all: Votaciones
|
all: Votaciones
|
||||||
|
|||||||
@@ -137,6 +137,20 @@ feature 'Stats' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "Deleted proposals" do
|
||||||
|
proposal_notification = create(:proposal_notification)
|
||||||
|
proposal_notification.proposal.destroy
|
||||||
|
|
||||||
|
visit admin_stats_path
|
||||||
|
click_link "Proposal notifications"
|
||||||
|
|
||||||
|
expect(page).to have_css(".proposal_notification", count: 1)
|
||||||
|
|
||||||
|
expect(page).to have_content proposal_notification.title
|
||||||
|
expect(page).to have_content proposal_notification.body
|
||||||
|
expect(page).to have_content "Proposal not available"
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context "Direct messages" do
|
context "Direct messages" do
|
||||||
|
|||||||
Reference in New Issue
Block a user