diff options
Diffstat (limited to 'features/support/env.rb')
-rw-r--r-- | features/support/env.rb | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/features/support/env.rb b/features/support/env.rb index 1690465d9b2..15211995918 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -10,24 +10,26 @@ if ENV['CI'] Knapsack::Adapters::SpinachAdapter.bind end -%w(select2_helper test_env repo_helpers wait_for_requests sidekiq).each do |f| +WebMock.enable! + +%w(select2_helper test_env repo_helpers wait_for_requests sidekiq project_forks_helper webmock).each do |f| require Rails.root.join('spec', 'support', f) end Dir["#{Rails.root}/features/steps/shared/*.rb"].each { |file| require file } -WebMock.allow_net_connect! - Spinach.hooks.before_run do include RSpec::Mocks::ExampleMethods + include ActiveJob::TestHelper + include FactoryBot::Syntax::Methods + include GitlabRoutingHelper + RSpec::Mocks.setup TestEnv.init(mailer: false) # skip pre-receive hook check so we can use # web editor and merge TestEnv.disable_pre_receive - - include FactoryGirl::Syntax::Methods end Spinach.hooks.after_scenario do |scenario_data, step_definitions| @@ -41,11 +43,11 @@ module StdoutReporterWithScenarioLocation # Override the standard reporter to show filename and line number next to each # scenario for easy, focused re-runs def before_scenario_run(scenario, step_definitions = nil) - @max_step_name_length = scenario.steps.map(&:name).map(&:length).max if scenario.steps.any? + @max_step_name_length = scenario.steps.map(&:name).map(&:length).max if scenario.steps.any? # rubocop:disable Gitlab/ModuleWithInstanceVariables name = scenario.name # This number has no significance, it's just to line things up - max_length = @max_step_name_length + 19 + max_length = @max_step_name_length + 19 # rubocop:disable Gitlab/ModuleWithInstanceVariables out.puts "\n #{'Scenario:'.green} #{name.light_green.ljust(max_length)}" \ " # #{scenario.feature.filename}:#{scenario.line}" end |