From 9ff23cf897c412a612473c9288f764f8d435fdbf Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Mon, 12 Jan 2015 18:30:37 -0300 Subject: [PATCH] Using environment default_hostname in person notifier --- app/models/person_notifier.rb | 4 ++-- test/unit/person_notifier_test.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/person_notifier.rb b/app/models/person_notifier.rb index 62761a4..fa2a1f9 100644 --- a/app/models/person_notifier.rb +++ b/app/models/person_notifier.rb @@ -84,8 +84,8 @@ class PersonNotifier def content_summary(person, notifications, tasks) if person.environment - ActionMailer::Base.asset_host = person.environment.top_url - ActionMailer::Base.default_url_options[:host] = person.environment.top_url.gsub(/^(https?:)?/, '') + ActionMailer::Base.asset_host = person.environment.default_hostname + ActionMailer::Base.default_url_options[:host] = person.environment.default_hostname end @current_theme = 'default' diff --git a/test/unit/person_notifier_test.rb b/test/unit/person_notifier_test.rb index dac964e..76a9e7f 100644 --- a/test/unit/person_notifier_test.rb +++ b/test/unit/person_notifier_test.rb @@ -243,7 +243,7 @@ class PersonNotifierTest < ActiveSupport::TestCase notify sent = ActionMailer::Base.deliveries.last assert_match /src="\/\/www.gravatar.com\/avatar.*"/, sent.body.to_s - assert_match /src="http:\/\/colivre.net\/images\/icons-app\/community-icon.png.*"/, sent.body.to_s + assert_match /src="\/\/localhost\/images\/icons-app\/community-icon.png.*"/, sent.body.to_s end should 'list tasks in notification mail' do -- libgit2 0.21.2