diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-03-07 18:19:52 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-03-08 16:00:24 +0300 |
commit | 825c53c1dacf095a66bb565ed7ef22a0e6dbfca9 (patch) | |
tree | 7faa44b045312807a9a09b879769faf397742a03 | |
parent | d1a968d4b338d2d321f88336a3bc1e76a9a5da1f (diff) |
Enable CSRF protection in JS tests43966-enable-csrf-in-tests
-rw-r--r-- | spec/spec_helper.rb | 8 |
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 |