aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/test_case_test.rb
diff options
context:
space:
mode:
authorGodfrey Chan <godfreykfc@gmail.com>2014-11-10 00:30:08 -0800
committerGodfrey Chan <godfreykfc@gmail.com>2014-11-10 00:31:49 -0800
commitaa6637d140c2ebd28bbd23fc250af033a065dbe8 (patch)
tree547015bc9079ccbff588d6968d804de5b9019ce5 /actionpack/test/controller/test_case_test.rb
parent52c3a16fa07cde643af3c2200e4b87bcb470eb12 (diff)
downloadrails-aa6637d140c2ebd28bbd23fc250af033a065dbe8.tar.gz
rails-aa6637d140c2ebd28bbd23fc250af033a065dbe8.tar.bz2
rails-aa6637d140c2ebd28bbd23fc250af033a065dbe8.zip
Pass the route name explicitly
Follow up to 212057b9. Since that commit, we need to pass the `route_name` explicitly. This is one of the left-over cases that was not handled in that commit, which was causing `use_route` to be ignored in functional tests.
Diffstat (limited to 'actionpack/test/controller/test_case_test.rb')
-rw-r--r--actionpack/test/controller/test_case_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/controller/test_case_test.rb b/actionpack/test/controller/test_case_test.rb
index 9d7abd5e94..957c0a5288 100644
--- a/actionpack/test/controller/test_case_test.rb
+++ b/actionpack/test/controller/test_case_test.rb
@@ -499,6 +499,18 @@ XML
end
end
+ def test_use_route
+ with_routing do |set|
+ set.draw do
+ get 'via_unnamed_route', to: 'test_case_test/test#test_uri'
+ get 'via_named_route', as: :a_named_route, to: 'test_case_test/test#test_uri'
+ end
+
+ get :test_uri, use_route: :a_named_route
+ assert_equal '/via_named_route', @response.body
+ end
+ end
+
def test_assert_realistic_path_parameters
get :test_params, :id => 20, :foo => Object.new