aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2013-03-19 18:48:49 -0700
committerAndrew White <andyw@pixeltrix.co.uk>2013-03-19 18:48:49 -0700
commit730f725509f7c504837510a466bd693551bacb82 (patch)
tree729d90038ed631b627bf2a8dacbe3c2d4ed4fb3b /actionpack/test
parentbdf1a2e7b9096889321f7653a0ccca628a089e2f (diff)
parent334549b4a56ae753b564b6beeded88322306c7cb (diff)
downloadrails-730f725509f7c504837510a466bd693551bacb82.tar.gz
rails-730f725509f7c504837510a466bd693551bacb82.tar.bz2
rails-730f725509f7c504837510a466bd693551bacb82.zip
Merge pull request #9794 from schneems/schneems/email-host
Fix improperly configured host in generated urls
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/dispatch/url_generation_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/url_generation_test.rb b/actionpack/test/dispatch/url_generation_test.rb
index e56e8ddc57..4123529092 100644
--- a/actionpack/test/dispatch/url_generation_test.rb
+++ b/actionpack/test/dispatch/url_generation_test.rb
@@ -48,6 +48,14 @@ module TestUrlGeneration
https!
assert_equal "http://www.example.com/foo", foo_url(:protocol => "http")
end
+
+ test "extracting protocol from host when protocol not present" do
+ assert_equal "httpz://www.example.com/foo", foo_url(host: "httpz://www.example.com", protocol: nil)
+ end
+
+ test "formatting host when protocol is present" do
+ assert_equal "http://www.example.com/foo", foo_url(host: "httpz://www.example.com", protocol: "http://")
+ end
end
end