aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/base_test.rb
diff options
context:
space:
mode:
authorLuke Redpath <contact@lukeredpath.co.uk>2008-06-05 13:20:54 +0100
committerPratik Naik <pratiknaik@gmail.com>2008-06-17 20:53:41 +0100
commit7650ff892cbffcaaaf9c5ab72466e98903a202d3 (patch)
treebc0a124be51c0fe7711e479aecfa24cf3e8c947c /actionpack/test/controller/base_test.rb
parentbc4a2f156b368334ca7267d15f4dd10864ac492d (diff)
downloadrails-7650ff892cbffcaaaf9c5ab72466e98903a202d3.tar.gz
rails-7650ff892cbffcaaaf9c5ab72466e98903a202d3.tar.bz2
rails-7650ff892cbffcaaaf9c5ab72466e98903a202d3.zip
Fix url_for with no arguments when default_url_options is not explicitly defined. [#339 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'actionpack/test/controller/base_test.rb')
-rw-r--r--actionpack/test/controller/base_test.rb18
1 files changed, 17 insertions, 1 deletions
diff --git a/actionpack/test/controller/base_test.rb b/actionpack/test/controller/base_test.rb
index b28717597e..34c0200fe8 100644
--- a/actionpack/test/controller/base_test.rb
+++ b/actionpack/test/controller/base_test.rb
@@ -169,6 +169,22 @@ class DefaultUrlOptionsTest < Test::Unit::TestCase
end
end
+class EmptyUrlOptionsTest < Test::Unit::TestCase
+ def setup
+ @controller = NonEmptyController.new
+
+ @request = ActionController::TestRequest.new
+ @response = ActionController::TestResponse.new
+
+ @request.host = 'www.example.com'
+ end
+
+ def test_ensure_url_for_works_as_expected_when_called_with_no_options_if_default_url_options_is_not_set
+ get :public_action
+ assert_equal "http://www.example.com/non_empty/public_action", @controller.url_for
+ end
+end
+
class EnsureNamedRoutesWorksTicket22BugTest < Test::Unit::TestCase
def test_named_routes_still_work
ActionController::Routing::Routes.draw do |map|
@@ -180,4 +196,4 @@ class EnsureNamedRoutesWorksTicket22BugTest < Test::Unit::TestCase
ensure
ActionController::Routing::Routes.load!
end
-end \ No newline at end of file
+end