diff options
author | Andrew Kampjes <a.kampjes@gmail.com> | 2014-10-25 23:14:05 +1300 |
---|---|---|
committer | Andrew Kampjes <a.kampjes@gmail.com> | 2015-08-14 08:05:11 +1200 |
commit | f0a3af209f021774f0f2360d8843a3f630312431 (patch) | |
tree | 4630f56d27d07f1322eaeb56a84c17c0b63ce643 /railties/test/application | |
parent | e50fe85180648be0c4216bd0111f05be1df0988a (diff) | |
download | rails-f0a3af209f021774f0f2360d8843a3f630312431.tar.gz rails-f0a3af209f021774f0f2360d8843a3f630312431.tar.bz2 rails-f0a3af209f021774f0f2360d8843a3f630312431.zip |
ActionMailer https on URL with force_ssl = true
`config.force_ssl = true` will set
config.action_mailer.default_url_options = { protocol: 'https' }
If you have turned on force_ssl, and then gone to the effort of setting
config.action_mailer.default_url_options = {host: 'example.com'} then
you are probably pointing people back to your current app and want
https on that too.
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/initializers/frameworks_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/railties/test/application/initializers/frameworks_test.rb b/railties/test/application/initializers/frameworks_test.rb index 7bba910b9e..fc501f54ea 100644 --- a/railties/test/application/initializers/frameworks_test.rb +++ b/railties/test/application/initializers/frameworks_test.rb @@ -50,6 +50,17 @@ module ApplicationTests assert_equal "test.rails", ActionMailer::Base.default_url_options[:host] end + test "Default to HTTPS for ActionMailer URLs when force_ssl is on" do + app_file "config/environments/development.rb", <<-RUBY + Rails.application.configure do + config.force_ssl = true + end + RUBY + + require "#{app_path}/config/environment" + assert_equal "https", ActionMailer::Base.default_url_options[:protocol] + end + test "includes url helpers as action methods" do app_file "config/routes.rb", <<-RUBY Rails.application.routes.draw do |