From f550d4db96b406efc91f92a9c8ebdcda7d407bc9 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Fri, 1 Jun 2012 17:42:33 +0200 Subject: 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 --- actionpack/test/template/test_case_test.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'actionpack/test/template/test_case_test.rb') diff --git a/actionpack/test/template/test_case_test.rb b/actionpack/test/template/test_case_test.rb index a75f1bc981..13a2b7fb6f 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 } -- cgit v1.2.3