summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-07-27 10:20:52 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-07-27 10:20:52 +0000
commitef50875d3aa27a8e7bcc3296f911da4710be0585 (patch)
tree6b3522c20239dc319719203372464a0aa88fd9cb /spec/support
parent2850efcdd51909a5a92f844e7b8940ed0190d234 (diff)
parentbfe8b96874c66c54e2e4c1a66a520087b217e9e7 (diff)
downloadgitlab-ce-ef50875d3aa27a8e7bcc3296f911da4710be0585.tar.gz
Merge branch '33601-add-csrf-token-verification-to-api' into 'master'
Resolve "Add CSRF token verification to API" Closes #33601 See merge request !12154
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/forgery_protection.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/support/forgery_protection.rb b/spec/support/forgery_protection.rb
new file mode 100644
index 00000000000..a5e7b761651
--- /dev/null
+++ b/spec/support/forgery_protection.rb
@@ -0,0 +1,11 @@
+RSpec.configure do |config|
+ config.around(:each, :allow_forgery_protection) do |example|
+ begin
+ ActionController::Base.allow_forgery_protection = true
+
+ example.call
+ ensure
+ ActionController::Base.allow_forgery_protection = false
+ end
+ end
+end