aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/url_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-12-23 18:59:24 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-12-23 18:59:24 +0000
commit00deaf6d56085d4961eff8e8e0948a9241dfd5ea (patch)
tree933aa1f6b17a6021590112509156c9247f3a6727 /actionpack/test/controller/url_test.rb
parent8e413262d6cca1ea3b481b7fd7ebf34320425285 (diff)
downloadrails-00deaf6d56085d4961eff8e8e0948a9241dfd5ea.tar.gz
rails-00deaf6d56085d4961eff8e8e0948a9241dfd5ea.tar.bz2
rails-00deaf6d56085d4961eff8e8e0948a9241dfd5ea.zip
Added :host and :protocol options to url_for and friends to redirect to another host and protocol than the current.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@266 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller/url_test.rb')
-rw-r--r--actionpack/test/controller/url_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/test/controller/url_test.rb b/actionpack/test/controller/url_test.rb
index 10577382a6..5cae4e289b 100644
--- a/actionpack/test/controller/url_test.rb
+++ b/actionpack/test/controller/url_test.rb
@@ -60,6 +60,20 @@ class UrlTest < Test::Unit::TestCase
assert_equal "http://www.singlefile.com/library/books/ISBN/0743536703/edit", @library_url.rewrite(:action => "edit")
end
+ def test_clean_action_to_another_host
+ assert_equal(
+ "http://www.booksphere.com/library/books/ISBN/0743536703/edit",
+ @library_url.rewrite(:action => "edit", :host => "www.booksphere.com")
+ )
+ end
+
+ def test_clean_action_to_another_host_and_protocol
+ assert_equal(
+ "https://www.booksphere.com/library/books/ISBN/0743536703/edit",
+ @library_url.rewrite(:action => "edit", :host => "www.booksphere.com", :protocol => "https://")
+ )
+ end
+
def test_clean_action_with_only_path
assert_equal "/library/books/ISBN/0743536703/edit", @library_url.rewrite(:action => "edit", :only_path => true)
end