diff --git a/app/controllers/management/proposals_controller.rb b/app/controllers/management/proposals_controller.rb index 4f6ca18c4..2ce74d6d5 100644 --- a/app/controllers/management/proposals_controller.rb +++ b/app/controllers/management/proposals_controller.rb @@ -13,6 +13,7 @@ class Management::ProposalsController < Management::BaseController def show super + @notifications = @proposal.notifications redirect_to management_proposal_path(@proposal), status: :moved_permanently if request.path != management_proposal_path(@proposal) end diff --git a/app/views/mailer/direct_message_for_receiver.html.erb b/app/views/mailer/direct_message_for_receiver.html.erb index eb1e56fe7..2523f3502 100644 --- a/app/views/mailer/direct_message_for_receiver.html.erb +++ b/app/views/mailer/direct_message_for_receiver.html.erb @@ -27,8 +27,8 @@
<%= t('mailers.direct_message_for_receiver.unsubscribe', - account: link_to(t('mailers.proposal_notification_digest.unsubscribe_account'), - account_path, style: "color: #2895F1; text-decoration: none;")).html_safe %> + account: link_to(t('mailers.direct_message_for_receiver.unsubscribe_account'), + account_url, style: "color: #2895F1; text-decoration: none;")).html_safe %>
<%= t('mailers.proposal_notification_digest.unsubscribe', account: link_to(t('mailers.proposal_notification_digest.unsubscribe_account'), - account_path, style: "color: #2895F1; text-decoration: none;")).html_safe %> + account_url, style: "color: #2895F1; text-decoration: none;")).html_safe %>
diff --git a/config/i18n-tasks.yml b/config/i18n-tasks.yml index d24cc6eab..250ed18f9 100644 --- a/config/i18n-tasks.yml +++ b/config/i18n-tasks.yml @@ -96,6 +96,7 @@ search: ignore_missing: - 'unauthorized.*' - 'activerecord.errors.models.proposal_notification.*' + - 'activerecord.errors.models.direct_message.*' - 'errors.messages.blank' - 'errors.messages.taken' - 'devise.failure.invalid' diff --git a/config/locales/en.yml b/config/locales/en.yml index 64ee8fb6f..b16f1092a 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -143,6 +143,7 @@ en: accept_terms_title: I agree to the Privacy Policy and the Terms and conditions of use conditions: Terms and conditions of use debate: Debate + direct_message: private message error: error errors: errors not_saved: 'prevented this %{resource} from being saved:' diff --git a/db/seeds.rb b/db/seeds.rb index 5644fe493..4a4741a07 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -77,4 +77,4 @@ Setting['banner-img.banner-img-three'] = "Banner image 3" # Proposal notifications Setting['proposal_notification_minimum_interval_in_days '] = 3 -Setting['direct_message_max_per_day '] = 3 \ No newline at end of file +Setting['direct_message_max_per_day'] = 3 \ No newline at end of file diff --git a/spec/features/comments/proposals_spec.rb b/spec/features/comments/proposals_spec.rb index 53b1006c3..8312176cd 100644 --- a/spec/features/comments/proposals_spec.rb +++ b/spec/features/comments/proposals_spec.rb @@ -168,7 +168,10 @@ feature 'Commenting proposals' do within "#comments" do expect(page).to have_content 'Have you thought about...?' - expect(page).to have_content '(1)' + end + + within "#tab-comments-label" do + expect(page).to have_content 'Comments (1)' end end diff --git a/spec/features/emails_spec.rb b/spec/features/emails_spec.rb index 3ea8f16b9..f793b5bb7 100644 --- a/spec/features/emails_spec.rb +++ b/spec/features/emails_spec.rb @@ -205,7 +205,7 @@ feature 'Emails' do email_digest.create email = open_last_email - expect(email).to have_subject("Email digest") + expect(email).to have_subject("Proposal notifications in Consul") expect(email).to deliver_to(user.email) expect(email).to have_body_text(proposal1.title) @@ -226,6 +226,7 @@ feature 'Emails' do expect(email).to have_body_text(proposal2.author.name) expect(email).to_not have_body_text(proposal3.title) + expect(email).to have_body_text(/#{account_path}/) end end diff --git a/spec/features/proposal_notifications_spec.rb b/spec/features/proposal_notifications_spec.rb index be8b146fd..6092289f0 100644 --- a/spec/features/proposal_notifications_spec.rb +++ b/spec/features/proposal_notifications_spec.rb @@ -12,7 +12,7 @@ feature 'Proposal Notifications' do click_link "My activity" within("#proposal_#{proposal.id}") do - click_link "Send message" + click_link "Send notification" end fill_in 'proposal_notification_title', with: "Thank you for supporting my proposal" @@ -48,7 +48,7 @@ feature 'Proposal Notifications' do 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)) + expect(page).to have_link("the proposal's page", href: proposal_path(proposal, anchor: 'comments')) end context "Permissions" do @@ -62,7 +62,7 @@ feature 'Proposal Notifications' do visit user_path(author) within("#proposal_#{proposal.id}") do - expect(page).to have_link "Send message" + expect(page).to have_link "Send notification" end login_as(user) diff --git a/spec/support/common_actions.rb b/spec/support/common_actions.rb index 8eba8b13d..80bdde907 100644 --- a/spec/support/common_actions.rb +++ b/spec/support/common_actions.rb @@ -203,7 +203,7 @@ module CommonActions click_link "My activity" within("#proposal_#{proposal.id}") do - click_link "Send message" + click_link "Send notification" end fill_in 'proposal_notification_title', with: "Thank you for supporting my proposal #{proposal.title}" @@ -224,6 +224,7 @@ module CommonActions fill_in 'direct_message_title', with: "Hey #{receiver.name}!" fill_in 'direct_message_body', with: "How are you doing? This is #{sender.name}" + click_button "Send message" expect(page).to have_content "You message has been sent successfully."