gitlab-org--gitlab-foss/features/support/env.rb

43 lines
878 B
Ruby
Raw Normal View History

if ENV['SIMPLECOV']
require 'simplecov'
end
if ENV['COVERALLS']
2013-03-10 18:26:27 +00:00
require 'coveralls'
Coveralls.wear_merged!
2013-03-10 18:26:27 +00:00
end
2012-09-10 07:52:43 +00:00
ENV['RAILS_ENV'] = 'test'
require './config/environment'
require 'rspec/expectations'
2013-01-09 06:14:05 +00:00
require 'sidekiq/testing/inline'
require_relative 'capybara'
require_relative 'db_cleaner'
2016-03-09 13:12:08 +00:00
require_relative 'rerun'
2016-06-08 09:43:13 +00:00
if ENV['CI']
require 'knapsack'
Knapsack::Adapters::RSpecAdapter.bind
end
%w(select2_helper test_env repo_helpers).each do |f|
require Rails.root.join('spec', 'support', f)
end
Dir["#{Rails.root}/features/steps/shared/*.rb"].each { |file| require file }
2012-09-10 15:35:03 +00:00
WebMock.allow_net_connect!
Spinach.hooks.before_run do
include RSpec::Mocks::ExampleMethods
RSpec::Mocks.setup
2014-07-31 16:24:53 +00:00
TestEnv.init(mailer: false)
2015-08-14 13:08:31 +00:00
# skip pre-receive hook check so we can use
# web editor and merge
TestEnv.disable_pre_receive
include FactoryGirl::Syntax::Methods
end