BigW Consortium Gitlab

env.rb 827 Bytes
Newer Older
1 2
require './spec/simplecov_env'
SimpleCovEnv.start!
3

4 5
ENV['RAILS_ENV'] = 'test'
require './config/environment'
6
require 'rspec/expectations'
7 8
require 'sidekiq/testing/inline'

9 10
require_relative 'capybara'
require_relative 'db_cleaner'
Kamil Trzcinski committed
11
require_relative 'rerun'
12

13 14
if ENV['CI']
  require 'knapsack'
15
  Knapsack::Adapters::SpinachAdapter.bind
16
end
17

18
%w(select2_helper test_env repo_helpers wait_for_ajax).each do |f|
19 20 21
  require Rails.root.join('spec', 'support', f)
end

22
Dir["#{Rails.root}/features/steps/shared/*.rb"].each { |file| require file }
Nihad Abbasov committed
23

24 25 26
WebMock.allow_net_connect!

Spinach.hooks.before_run do
27
  include RSpec::Mocks::ExampleMethods
28
  RSpec::Mocks.setup
29
  TestEnv.init(mailer: false)
30

31 32 33 34
  # skip pre-receive hook check so we can use
  # web editor and merge
  TestEnv.disable_pre_receive

35
  include FactoryGirl::Syntax::Methods
36
end