diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-07-10 17:24:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-10 17:24:31 -0400 |
commit | 48cb8b3e7097e9a1cb45b2298f59b9179f0dbdee (patch) | |
tree | 3829cb73ad09675ba74fa4443d320c8fd3c4384c /railties/test | |
parent | 3fa66935fd65e2d834dcc743bd835afb5b875f7f (diff) | |
parent | 73b944eca721be750e1263c15d221f153d1396d0 (diff) | |
download | rails-48cb8b3e7097e9a1cb45b2298f59b9179f0dbdee.tar.gz rails-48cb8b3e7097e9a1cb45b2298f59b9179f0dbdee.tar.bz2 rails-48cb8b3e7097e9a1cb45b2298f59b9179f0dbdee.zip |
Merge pull request #29742 from lugray/default_protect_from_forgery
Default protect from forgery
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/configuration_test.rb | 7 | ||||
-rw-r--r-- | railties/test/application/rake_test.rb | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index 983ea5c3e6..6c0c087331 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -1209,6 +1209,13 @@ module ApplicationTests assert_equal false, ActionController::Parameters.action_on_unpermitted_parameters end + test "config.action_controller.default_protect_from_forgery is true by default" do + app "development" + + assert_equal true, ActionController::Base.default_protect_from_forgery + assert_includes ActionController::Base.__callbacks[:process_action].map(&:filter), :verify_authenticity_token + end + test "config.action_controller.permit_all_parameters can be configured in an initializer" do app_file "config/initializers/permit_all_parameters.rb", <<-RUBY Rails.application.config.action_controller.permit_all_parameters = true diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb index 5ae6ea925f..134106812d 100644 --- a/railties/test/application/rake_test.rb +++ b/railties/test/application/rake_test.rb @@ -117,7 +117,7 @@ module ApplicationTests end def test_code_statistics_sanity - assert_match "Code LOC: 26 Test LOC: 0 Code to Test Ratio: 1:0.0", + assert_match "Code LOC: 25 Test LOC: 0 Code to Test Ratio: 1:0.0", Dir.chdir(app_path) { `bin/rails stats` } end |