mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-24 08:52:14 -04:00
use fully qualified links in notification email
This commit is contained in:
@@ -3,18 +3,18 @@
|
||||
|
||||
%p
|
||||
You have received a message from
|
||||
= link_to @notification.sender.login_name, url_for(@notification.sender)
|
||||
= link_to @notification.sender.login_name, url_for(:controller => 'members', :action => 'show', :id => @notification.sender.id, :only_path => false )
|
||||
on #{site_name} at #{@notification.created_at.to_s(:date)}
|
||||
- if @notification.post
|
||||
in response to
|
||||
= link_to @notification.post.subject, url_for(@notification.post)
|
||||
= link_to @notification.post.subject, url_for(:controller => 'posts', :action => 'show', :id => @notification.post.id, :only_path => false)
|
||||
\.
|
||||
%blockquote
|
||||
:markdown
|
||||
#{strip_tags @notification.body}
|
||||
|
||||
%p
|
||||
= link_to "View this message in your inbox", url_for(@notification)
|
||||
= link_to "View this message in your inbox", url_for(:controller => 'notifications', :action => 'show', :id => @notification.id, :only_path => false)
|
||||
%br/
|
||||
= link_to "Turn off these notifications", edit_member_registration_url
|
||||
|
||||
|
||||
@@ -17,6 +17,13 @@ describe 'notifier/notify.html.haml', :type => "view" do
|
||||
end
|
||||
|
||||
it 'should contain a link to your inbox' do
|
||||
assert_select "a[href=#{url_for(@notification)}]"
|
||||
assert_select "a[href*=notifications]"
|
||||
end
|
||||
|
||||
it 'should have fully qualified URLs' do
|
||||
# lots of lovely fully qualified URLs
|
||||
assert_select "a[href^=http]", { :minimum => 4 }
|
||||
# no relative URLs starting with /
|
||||
assert_select "a[href^=/]", { :count => 0 }
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user