Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/capybara.rb')
-rw-r--r--spec/support/capybara.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb
index 66fce4fddf1..27c360ee39a 100644
--- a/spec/support/capybara.rb
+++ b/spec/support/capybara.rb
@@ -123,6 +123,10 @@ RSpec.configure do |config|
port: session.server.port,
protocol: 'http')
+ # CSRF protection is disabled by default. We only enable this for JS specs because some forms
+ # require Javascript to set the CSRF token.
+ allow_any_instance_of(ActionController::Base).to receive(:protect_against_forgery?).and_return(true)
+
# reset window size between tests
unless session.current_window.size == CAPYBARA_WINDOW_SIZE
begin