Change Proposal Notification Digest link to anchor

On the proposal notification digest messages there was a link to each
notification. Instead we need that link to point towards the notifications
tab of the proposal.
This commit is contained in:
Bertocq
2018-04-18 16:23:19 +02:00
committed by decabeza
parent eb0919d978
commit ac9f85e208
3 changed files with 9 additions and 7 deletions

View File

@@ -22,7 +22,7 @@
<tr> <tr>
<td style="padding-bottom: 20px; padding-left: 10px;"> <td style="padding-bottom: 20px; padding-left: 10px;">
<p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif;font-size: 20px;font-weight: bold;line-height: 24px; margin: 0;"> <p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif;font-size: 20px;font-weight: bold;line-height: 24px; margin: 0;">
<%= link_to notification.notifiable.title, notification_url(notification), style: "color: #2895F1; text-decoration: none;" %> <%= link_to notification.notifiable.title, proposal_url(notification.notifiable.proposal, anchor: "tab-notifications"), style: "color: #2895F1; text-decoration: none;" %>
</p> </p>
<p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif;font-size: 14px;font-weight: normal;line-height: 24px; margin-top: 0; color: #cccccc;"> <p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif;font-size: 14px;font-weight: normal;line-height: 24px; margin-top: 0; color: #cccccc;">
<%= notification.notifiable.proposal.title %>&nbsp;&bull;&nbsp; <%= notification.notifiable.proposal.title %>&nbsp;&bull;&nbsp;

View File

@@ -27,14 +27,16 @@ feature "System Emails" do
proposal_notification_b = create(:proposal_notification, proposal: proposal_b, proposal_notification_b = create(:proposal_notification, proposal: proposal_b,
title: 'Proposal B Title', title: 'Proposal B Title',
body: 'Proposal B Notification Body') body: 'Proposal B Notification Body')
notification_a = create(:notification, notifiable: proposal_notification_a) create(:notification, notifiable: proposal_notification_a)
notification_b = create(:notification, notifiable: proposal_notification_b) create(:notification, notifiable: proposal_notification_b)
visit admin_system_email_view_path('proposal_notification_digest') visit admin_system_email_view_path('proposal_notification_digest')
expect(page).to have_content('Proposal notifications in') expect(page).to have_content('Proposal notifications in')
expect(page).to have_link('Proposal A Title', href: notification_url(notification_a)) expect(page).to have_link('Proposal A Title', href: proposal_url(proposal_a,
expect(page).to have_link('Proposal B Title', href: notification_url(notification_b)) anchor: 'tab-notifications'))
expect(page).to have_link('Proposal B Title', href: proposal_url(proposal_b,
anchor: 'tab-notifications'))
expect(page).to have_content('Proposal A Notification Body') expect(page).to have_content('Proposal A Notification Body')
expect(page).to have_content('Proposal B Notification Body') expect(page).to have_content('Proposal B Notification Body')
end end

View File

@@ -306,14 +306,14 @@ feature 'Emails' do
expect(email).to have_body_text(notification1.notifiable.body) expect(email).to have_body_text(notification1.notifiable.body)
expect(email).to have_body_text(proposal1.author.name) expect(email).to have_body_text(proposal1.author.name)
expect(email).to have_body_text(/#{notification_path(notification1)}/) expect(email).to have_body_text(/#{proposal_path(proposal1, anchor: 'tab-notifications')}/)
expect(email).to have_body_text(/#{proposal_path(proposal1, anchor: 'comments')}/) expect(email).to have_body_text(/#{proposal_path(proposal1, anchor: 'comments')}/)
expect(email).to have_body_text(/#{proposal_path(proposal1, anchor: 'social-share')}/) expect(email).to have_body_text(/#{proposal_path(proposal1, anchor: 'social-share')}/)
expect(email).to have_body_text(proposal2.title) expect(email).to have_body_text(proposal2.title)
expect(email).to have_body_text(notification2.notifiable.title) expect(email).to have_body_text(notification2.notifiable.title)
expect(email).to have_body_text(notification2.notifiable.body) expect(email).to have_body_text(notification2.notifiable.body)
expect(email).to have_body_text(/#{notification_path(notification2)}/) expect(email).to have_body_text(/#{proposal_path(proposal2, anchor: 'tab-notifications')}/)
expect(email).to have_body_text(/#{proposal_path(proposal2, anchor: 'comments')}/) expect(email).to have_body_text(/#{proposal_path(proposal2, anchor: 'comments')}/)
expect(email).to have_body_text(/#{proposal_path(proposal2, anchor: 'social-share')}/) expect(email).to have_body_text(/#{proposal_path(proposal2, anchor: 'social-share')}/)
expect(email).to have_body_text(proposal2.author.name) expect(email).to have_body_text(proposal2.author.name)