From 10768aa20418a5c3d547da33d80b9ebe3f34efb0 Mon Sep 17 00:00:00 2001 From: "Akihiko Odaki (@fn_aki@pawoo.net)" Date: Fri, 2 Jun 2017 03:56:55 +0900 Subject: Spec response for forgery (#3248) Remove protect_from_forgery in ApiController, which is disabled by the following skip_before_action, as well. --- spec/controllers/application_controller_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'spec/controllers/application_controller_spec.rb') diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb index 83ec02401..9370dcdad 100644 --- a/spec/controllers/application_controller_spec.rb +++ b/spec/controllers/application_controller_spec.rb @@ -37,6 +37,16 @@ describe ApplicationController, type: :controller do end end + context 'forgery' do + subject do + ActionController::Base.allow_forgery_protection = true + routes.draw { post 'success' => 'anonymous#success' } + post 'success' + end + + include_examples 'respond_with_error', 422 + end + it "does not force ssl if LOCAL_HTTPS is not 'true'" do routes.draw { get 'success' => 'anonymous#success' } ClimateControl.modify LOCAL_HTTPS: '' do -- cgit