diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2010-10-26 14:27:18 +0100 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2010-10-26 14:27:18 +0100 |
commit | 4ba24ba043a00e61e97369e6664d5c0fcdbc0fe8 (patch) | |
tree | 1ed823580f576b96d747febd507442d053c55f40 /actionpack/test | |
parent | c40074c1c7253f89ca9daf69b1a61068a478f144 (diff) | |
download | rails-4ba24ba043a00e61e97369e6664d5c0fcdbc0fe8.tar.gz rails-4ba24ba043a00e61e97369e6664d5c0fcdbc0fe8.tar.bz2 rails-4ba24ba043a00e61e97369e6664d5c0fcdbc0fe8.zip |
Allow generated url helpers to be overriden [#5243 state:resolved]
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/url_helper_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb index a6fdf806a4..bc2548e06c 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionpack/test/template/url_helper_test.rb @@ -433,6 +433,10 @@ class UrlHelperControllerTest < ActionController::TestCase match 'url_helper_controller_test/url_helper/normalize_recall_params', :to => UrlHelperController.action(:normalize_recall), :as => :normalize_recall_params + + match '/url_helper_controller_test/url_helper/override_url_helper/default', + :to => 'url_helper_controller_test/url_helper#override_url_helper', + :as => :override_url_helper end def show @@ -468,6 +472,15 @@ class UrlHelperControllerTest < ActionController::TestCase end def rescue_action(e) raise e end + + def override_url_helper + render :inline => '<%= override_url_helper_path %>' + end + + def override_url_helper_path + '/url_helper_controller_test/url_helper/override_url_helper/override' + end + helper_method :override_url_helper_path end tests UrlHelperController @@ -527,6 +540,11 @@ class UrlHelperControllerTest < ActionController::TestCase get :show, :name => '123' assert_equal 'ok', @response.body end + + def test_url_helper_can_be_overriden + get :override_url_helper + assert_equal '/url_helper_controller_test/url_helper/override_url_helper/override', @response.body + end end class TasksController < ActionController::Base |