Commit 179d7702d899b2e5e20996b967b96a136e2f469f
1 parent
f071e372
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Using environment default_hostname in person notifier
Showing
2 changed files
with
2 additions
and
2 deletions
Show diff stats
app/models/person_notifier.rb
@@ -85,7 +85,7 @@ class PersonNotifier | @@ -85,7 +85,7 @@ class PersonNotifier | ||
85 | def content_summary(person, notifications, tasks) | 85 | def content_summary(person, notifications, tasks) |
86 | if person.environment | 86 | if person.environment |
87 | ActionMailer::Base.asset_host = person.environment.top_url | 87 | ActionMailer::Base.asset_host = person.environment.top_url |
88 | - ActionMailer::Base.default_url_options[:host] = person.environment.top_url.gsub(/^(https?:)?/, '') | 88 | + ActionMailer::Base.default_url_options[:host] = person.environment.default_hostname |
89 | end | 89 | end |
90 | 90 | ||
91 | @current_theme = 'default' | 91 | @current_theme = 'default' |
test/unit/person_notifier_test.rb
@@ -243,7 +243,7 @@ class PersonNotifierTest < ActiveSupport::TestCase | @@ -243,7 +243,7 @@ class PersonNotifierTest < ActiveSupport::TestCase | ||
243 | notify | 243 | notify |
244 | sent = ActionMailer::Base.deliveries.last | 244 | sent = ActionMailer::Base.deliveries.last |
245 | assert_match /src="\/\/www.gravatar.com\/avatar.*"/, sent.body.to_s | 245 | assert_match /src="\/\/www.gravatar.com\/avatar.*"/, sent.body.to_s |
246 | - assert_match /src="http:\/\/colivre.net\/images\/icons-app\/community-icon.png.*"/, sent.body.to_s | 246 | + assert_match /src="http:\/\/localhost\/images\/icons-app\/community-icon.png.*"/, sent.body.to_s |
247 | end | 247 | end |
248 | 248 | ||
249 | should 'list tasks in notification mail' do | 249 | should 'list tasks in notification mail' do |