BigW Consortium Gitlab

env.rb 806 Bytes
Newer Older
1 2 3
if ENV['SIMPLECOV']
  require 'simplecov'
end
4

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

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

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

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

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

25 26 27
WebMock.allow_net_connect!

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

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

36
  include FactoryGirl::Syntax::Methods
37
end