diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2012-06-01 17:42:33 +0200 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2012-06-01 17:45:06 +0200 |
commit | 60b4290f1b978d2220c913b99a6162e8f324f833 (patch) | |
tree | 2528b74b903d63d715a319d6e2d3152e4c5b77d0 /actionpack/test/template | |
parent | afcc7cc301c92046c2a74e6e29b4d946292bd0a2 (diff) | |
download | rails-60b4290f1b978d2220c913b99a6162e8f324f833.tar.gz rails-60b4290f1b978d2220c913b99a6162e8f324f833.tar.bz2 rails-60b4290f1b978d2220c913b99a6162e8f324f833.zip |
Allow to use mounted helpers in ActionView::TestCase
Similarly to 6525002, this allows to use routes helpers for mounted
helpers, but this time in ActionView::TestCase
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/test_case_test.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/actionpack/test/template/test_case_test.rb b/actionpack/test/template/test_case_test.rb index f2ed2ec609..c005f040eb 100644 --- a/actionpack/test/template/test_case_test.rb +++ b/actionpack/test/template/test_case_test.rb @@ -222,6 +222,25 @@ module ActionView end end + test "is able to use mounted routes" do + with_routing do |set| + app = Class.new do + def self.routes + @routes ||= ActionDispatch::Routing::RouteSet.new + end + + routes.draw { get "bar", :to => lambda {} } + + def self.call(*) + end + end + + set.draw { mount app => "/foo", :as => "foo_app" } + + assert_equal '/foo/bar', foo_app.bar_path + end + end + test "named routes can be used from helper included in view" do with_routing do |set| set.draw { resources :contents } |