Merge branch 'proposal-notifications' of github.com:consul/consul into proposal-notifications

This commit is contained in:
Alberto Garcia Cabeza
2016-06-06 17:26:56 +02:00
4 changed files with 25 additions and 0 deletions

View File

@@ -4,6 +4,14 @@
<h1><%= t("proposal_notifications.new.title") %></h1>
<p>
<%= t("proposal_notifications.new.info_about_receivers",
count: @proposal.voters.count) %>
<%= link_to t("proposal_notifications.new.proposal_page"),
proposal_path(@proposal) %>
</p>
<%= form_for @notification do |f| %>
<%= render "shared/errors", resource: @notification %>

View File

@@ -370,6 +370,8 @@ en:
title_label: "Title"
body_label: "Message"
submit_button: "Send message"
info_about_receivers: "This message will be send to %{count} people and it will be visible in "
proposal_page: "the proposal's page"
show:
back: "Go back to my activity"
shared:

View File

@@ -370,6 +370,8 @@ es:
title_label: "Título"
body_label: "Mensaje"
submit_button: "Enviar mensaje"
info_about_receivers: "Este mensaje se enviará a %{count} usuarios y se publicará en "
proposal_page: "la página de la propuesta"
show:
back: "Volver a mi actividad"
shared:

View File

@@ -38,6 +38,19 @@ feature 'Proposal Notifications' do
expect(page).to have_content "We are almost there please share with your peoples!"
end
scenario "Message about receivers" do
author = create(:user)
proposal = create(:proposal, author: author)
7.times { create(:vote, votable: proposal, vote_flag: true) }
login_as(author)
visit new_proposal_notification_path(proposal_id: proposal.id)
expect(page).to have_content "This message will be send to 7 people and it will be visible in the proposal's page"
expect(page).to have_link("the proposal's page", href: proposal_path(proposal))
end
context "Permissions" do
scenario "Link to send the message" do