diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-07-12 01:24:29 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-07-17 05:13:19 -0300 |
commit | 245eb34f2b17d94c90f2a2a1459744a99a567034 (patch) | |
tree | c370b82d04c30a21257b014276450131414a1acb /actionpack | |
parent | 9fcfb86c42d116cd4145b702dd5c73ce1493b5b9 (diff) | |
download | rails-245eb34f2b17d94c90f2a2a1459744a99a567034.tar.gz rails-245eb34f2b17d94c90f2a2a1459744a99a567034.tar.bz2 rails-245eb34f2b17d94c90f2a2a1459744a99a567034.zip |
Make sure the tests setup are made correctly
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/test/controller/request_forgery_protection_test.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/actionpack/test/controller/request_forgery_protection_test.rb b/actionpack/test/controller/request_forgery_protection_test.rb index d3f2ec6aa1..37a54e7878 100644 --- a/actionpack/test/controller/request_forgery_protection_test.rb +++ b/actionpack/test/controller/request_forgery_protection_test.rb @@ -509,15 +509,6 @@ end class RequestForgeryProtectionControllerUsingResetSessionTest < ActionController::TestCase include RequestForgeryProtectionTests - setup do - @old_request_forgery_protection_token = ActionController::Base.request_forgery_protection_token - ActionController::Base.request_forgery_protection_token = :custom_authenticity_token - end - - teardown do - ActionController::Base.request_forgery_protection_token = @old_request_forgery_protection_token - end - test 'should emit a csrf-param meta tag and a csrf-token meta tag' do @controller.stub :form_authenticity_token, @token + '<=?' do get :meta @@ -677,6 +668,15 @@ class CustomAuthenticityParamControllerTest < ActionController::TestCase end class PerFormTokensControllerTest < ActionController::TestCase + def setup + @old_request_forgery_protection_token = ActionController::Base.request_forgery_protection_token + ActionController::Base.request_forgery_protection_token = :custom_authenticity_token + end + + def teardown + ActionController::Base.request_forgery_protection_token = @old_request_forgery_protection_token + end + def test_per_form_token_is_same_size_as_global_token get :index expected = ActionController::RequestForgeryProtection::AUTHENTICITY_TOKEN_LENGTH |