Don't include Capybara::DSL in the global scope

This commit is contained in:
Stan Hu 2017-06-15 18:33:44 -07:00
parent 619a792861
commit 806ffd2cec
2 changed files with 2 additions and 1 deletions

View file

@ -32,7 +32,6 @@ end
Spinach.hooks.after_scenario do |scenario_data, step_definitions|
if scenario_data.tags.include?('javascript')
include Capybara::DSL
include WaitForRequests
block_and_wait_for_requests_complete
end

View file

@ -3,6 +3,8 @@ require_relative './wait_for_requests'
module WaitForRequests
extend self
include Capybara::DSL
# This is inspired by http://www.salsify.com/blog/engineering/tearing-capybara-ajax-tests
def block_and_wait_for_requests_complete
Gitlab::Testing::RequestBlockerMiddleware.block_requests!