Commit ce12749a authored by Rémy Coutable's avatar Rémy Coutable

Improve the Unsubscribe confirmation page

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent c61a54f7
- noteable = @sent_notification.noteable - noteable = @sent_notification.noteable
- noteable_type = @sent_notification.noteable_type.humanize(capitalize: false) - noteable_type = @sent_notification.noteable_type.humanize(capitalize: false)
- noteable_text = %(#{noteable_type} "#{noteable.title}" (#{noteable.to_reference})) - noteable_text = %(#{noteable.title} (#{noteable.to_reference}))
- title = "Unsubscribe from #{noteable_text}"
- page_title title - page_title "Unsubscribe", noteable_text, @sent_notification.noteable_type.humanize.pluralize, @sent_notification.project.name_with_namespace
%h3.page-title= title
%p= "Are you sure you want to unsubscribe from #{noteable_text}?" %h3.page-title
Unsubscribe from #{noteable_type} #{noteable_text}
%p
= succeed '?' do
Are you sure you want to unsubscribe from #{noteable_type}
= link_to noteable_text, url_for([@sent_notification.project.namespace.becomes(Namespace), @sent_notification.project, noteable])
%p %p
= link_to 'Unsubscribe', unsubscribe_sent_notification_path(@sent_notification, force: true), = link_to 'Unsubscribe', unsubscribe_sent_notification_path(@sent_notification, force: true),
......
...@@ -24,8 +24,8 @@ describe 'Unsubscribe links', feature: true do ...@@ -24,8 +24,8 @@ describe 'Unsubscribe links', feature: true do
visit body_link visit body_link
expect(current_path).to eq unsubscribe_sent_notification_path(SentNotification.last) expect(current_path).to eq unsubscribe_sent_notification_path(SentNotification.last)
expect(page).to have_text(%(Unsubscribe from issue "#{issue.title}" (#{issue.to_reference}))) expect(page).to have_text(%(Unsubscribe from issue #{issue.title} (#{issue.to_reference})))
expect(page).to have_text(%(Are you sure you want to unsubscribe from issue "#{issue.title}" (#{issue.to_reference})?)) expect(page).to have_text(%(Are you sure you want to unsubscribe from issue #{issue.title} (#{issue.to_reference})?))
expect(issue.subscribed?(recipient)).to be_truthy expect(issue.subscribed?(recipient)).to be_truthy
click_link 'Unsubscribe' click_link 'Unsubscribe'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment