diff options
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/CHANGELOG.md | 11 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/testing/integration.rb | 7 | ||||
-rw-r--r-- | actionpack/test/controller/integration_test.rb | 19 |
3 files changed, 35 insertions, 2 deletions
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index 6f737001de..5571513186 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -1,3 +1,13 @@ +## Rails 3.2.6 (unreleased) ## + +* Include mounted_helpers (helpers for accessing mounted engines) in ActionDispatch::IntegrationTest by default. *Piotr Sarnacki* + + +## Rails 3.2.5 (Jun 1, 2012) ## + +* No changes. + + ## Rails 3.2.4 (May 31, 2012) ## * Deprecate old APIs for highlight, excerpt and word_wrap *Jeremy Walker* @@ -24,6 +34,7 @@ * Strip [nil] from parameters hash. Thanks to Ben Murphy for reporting this! CVE-2012-2660 + ## Rails 3.2.3 (March 30, 2012) ## * Allow to lazy load `default_form_builder` by passing a `String` instead of a constant. *Piotr Sarnacki* diff --git a/actionpack/lib/action_dispatch/testing/integration.rb b/actionpack/lib/action_dispatch/testing/integration.rb index ad78854471..ac784b3b60 100644 --- a/actionpack/lib/action_dispatch/testing/integration.rb +++ b/actionpack/lib/action_dispatch/testing/integration.rb @@ -177,8 +177,11 @@ module ActionDispatch # If the app is a Rails app, make url_helpers available on the session # This makes app.url_for and app.foo_path available in the console - if app.respond_to?(:routes) && app.routes.respond_to?(:url_helpers) - singleton_class.class_eval { include app.routes.url_helpers } + if app.respond_to?(:routes) + singleton_class.class_eval do + include app.routes.url_helpers if app.routes.respond_to?(:url_helpers) + include app.routes.mounted_helpers if app.routes.respond_to?(:mounted_helpers) + end end reset! diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb index fda263310b..a9e59e2dbb 100644 --- a/actionpack/test/controller/integration_test.rb +++ b/actionpack/test/controller/integration_test.rb @@ -495,11 +495,26 @@ class ApplicationIntegrationTest < ActionDispatch::IntegrationTest @routes ||= ActionDispatch::Routing::RouteSet.new end + class MountedApp + def self.routes + @routes ||= ActionDispatch::Routing::RouteSet.new + end + + routes.draw do + match 'baz', :to => 'application_integration_test/test#index', :as => :baz + end + + def self.call(*) + end + end + routes.draw do match '', :to => 'application_integration_test/test#index', :as => :empty_string match 'foo', :to => 'application_integration_test/test#index', :as => :foo match 'bar', :to => 'application_integration_test/test#index', :as => :bar + + mount MountedApp => '/mounted', :as => "mounted" end def app @@ -512,6 +527,10 @@ class ApplicationIntegrationTest < ActionDispatch::IntegrationTest assert_equal '/bar', bar_path end + test "includes mounted helpers" do + assert_equal '/mounted/baz', mounted.baz_path + end + test "route helpers after controller access" do get '/' assert_equal '/', empty_string_path |