提交 3713867b 编写于 作者: D Douwe Maan

Merge branch 'ce-jej/group-saml-skip-forgery-protection' into 'master'

[CE] Backport with_forgery_protection spec helper

See merge request gitlab-org/gitlab-ce!18833
module ForgeryProtection
def with_forgery_protection
ActionController::Base.allow_forgery_protection = true
yield
ensure
ActionController::Base.allow_forgery_protection = false
end
module_function :with_forgery_protection
end
RSpec.configure do |config|
config.around(:each, :allow_forgery_protection) do |example|
begin
ActionController::Base.allow_forgery_protection = true
ForgeryProtection.with_forgery_protection do
example.call
ensure
ActionController::Base.allow_forgery_protection = false
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册