diff options
author | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-12-08 10:20:59 -0500 |
---|---|---|
committer | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-12-08 10:21:20 -0500 |
commit | 4ec7493e3cb9366df604f9f3082b4cd6f6dfd4fd (patch) | |
tree | a9ebf2deafa6a04bde975886d3fc98b630683ece /actionpack/test/controller/default_url_options_with_before_action_test.rb | |
parent | bef330803ae4a30bfeaf6dd9c86077cfb5e250e1 (diff) | |
download | rails-4ec7493e3cb9366df604f9f3082b4cd6f6dfd4fd.tar.gz rails-4ec7493e3cb9366df604f9f3082b4cd6f6dfd4fd.tar.bz2 rails-4ec7493e3cb9366df604f9f3082b4cd6f6dfd4fd.zip |
use _action callbacks in actionmailer
Diffstat (limited to 'actionpack/test/controller/default_url_options_with_before_action_test.rb')
-rw-r--r-- | actionpack/test/controller/default_url_options_with_before_action_test.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/actionpack/test/controller/default_url_options_with_before_action_test.rb b/actionpack/test/controller/default_url_options_with_before_action_test.rb new file mode 100644 index 0000000000..656fd0431e --- /dev/null +++ b/actionpack/test/controller/default_url_options_with_before_action_test.rb @@ -0,0 +1,29 @@ +require 'abstract_unit' + + +class ControllerWithBeforeActionAndDefaultUrlOptions < ActionController::Base + + before_action { I18n.locale = params[:locale] } + after_action { I18n.locale = "en" } + + def target + render :text => "final response" + end + + def redirect + redirect_to :action => "target" + end + + def default_url_options + {:locale => "de"} + end +end + +class ControllerWithBeforeActionAndDefaultUrlOptionsTest < ActionController::TestCase + + # This test has its roots in issue #1872 + test "should redirect with correct locale :de" do + get :redirect, :locale => "de" + assert_redirected_to "/controller_with_before_action_and_default_url_options/target?locale=de" + end +end |