summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-03-07 23:19:52 +0800
committerLin Jen-Shin <godfat@godfat.org>2018-03-08 21:00:24 +0800
commit825c53c1dacf095a66bb565ed7ef22a0e6dbfca9 (patch)
tree7faa44b045312807a9a09b879769faf397742a03
parentd1a968d4b338d2d321f88336a3bc1e76a9a5da1f (diff)
downloadgitlab-ce-43966-enable-csrf-in-tests.tar.gz
Enable CSRF protection in JS tests43966-enable-csrf-in-tests
-rw-r--r--spec/spec_helper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 9f6f0204a16..225d87251e8 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -127,6 +127,14 @@ RSpec.configure do |config|
reset_delivered_emails!
end
+ config.around(:example, :js) do |example|
+ Gitlab::Application.config.allow_forgery_protection = true
+
+ example.run
+
+ Gitlab::Application.config.allow_forgery_protection = false
+ end
+
config.around(:each, :use_clean_rails_memory_store_caching) do |example|
caching_store = Rails.cache
Rails.cache = ActiveSupport::Cache::MemoryStore.new