diff --git a/app/views/proposal_notifications/new.html.erb b/app/views/proposal_notifications/new.html.erb index 60f7e64e4..f8be10c2e 100644 --- a/app/views/proposal_notifications/new.html.erb +++ b/app/views/proposal_notifications/new.html.erb @@ -4,6 +4,14 @@

<%= t("proposal_notifications.new.title") %>

+

+ <%= t("proposal_notifications.new.info_about_receivers", + count: @proposal.voters.count) %> + + <%= link_to t("proposal_notifications.new.proposal_page"), + proposal_path(@proposal) %> +

+ <%= form_for @notification do |f| %> <%= render "shared/errors", resource: @notification %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 4d5816f4c..059cf5cd6 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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: diff --git a/config/locales/es.yml b/config/locales/es.yml index 36b318cc7..150c42583 100755 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -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: diff --git a/spec/features/proposal_notifications_spec.rb b/spec/features/proposal_notifications_spec.rb index 3046c6ab5..f40e0b81e 100644 --- a/spec/features/proposal_notifications_spec.rb +++ b/spec/features/proposal_notifications_spec.rb @@ -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