added_to_url = ''
case container.class.name
when 'Project'
- added_to_url = url_for(:controller => 'projects', :action => 'list_files', :id => container)
+ added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container)
added_to = "#{l(:label_project)}: #{container}"
recipients container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}.collect {|u| u.mail}
when 'Version'
- added_to_url = url_for(:controller => 'projects', :action => 'list_files', :id => container.project_id)
+ added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container.project)
added_to = "#{l(:label_version)}: #{container.name}"
recipients container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}.collect {|u| u.mail}
when 'Document'
ActionMailer::Base.deliveries.clear
Setting.host_name = 'mydomain.foo'
Setting.protocol = 'http'
+ Setting.plain_text_mail = '0'
end
def test_generated_links_in_emails
assert Mailer.deliver_attachments_added(attachements)
assert_not_nil last_email.bcc
assert last_email.bcc.any?
+ assert_select_email do
+ assert_select "a[href=?]", "http://mydomain.foo/projects/ecookbook/files"
+ end
end
def test_project_file_added
assert Mailer.deliver_attachments_added(attachements)
assert_not_nil last_email.bcc
assert last_email.bcc.any?
+ assert_select_email do
+ assert_select "a[href=?]", "http://mydomain.foo/projects/ecookbook/files"
+ end
end
def test_news_added