class SkipProtectionControllerTest
Public Instance Methods
assert_blocked() { || ... }
click to toggle source
# File actionpack/test/controller/request_forgery_protection_test.rb, line 988 def assert_blocked assert_raises(ActionController::InvalidAuthenticityToken) do yield end end
assert_not_blocked() { || ... }
click to toggle source
# File actionpack/test/controller/request_forgery_protection_test.rb, line 994 def assert_not_blocked assert_nothing_raised { yield } assert_response :success end
test_should_allow_post_without_token_when_skipping()
click to toggle source
# File actionpack/test/controller/request_forgery_protection_test.rb, line 983 def test_should_allow_post_without_token_when_skipping @controller.skip_requested = true assert_not_blocked { post :index } end
test_should_not_allow_post_without_token_when_not_skipping()
click to toggle source
# File actionpack/test/controller/request_forgery_protection_test.rb, line 978 def test_should_not_allow_post_without_token_when_not_skipping @controller.skip_requested = false assert_blocked { post :index } end