debian-mirror-gitlab/features/support/env.rb

37 lines
774 B
Ruby
Raw Normal View History

2015-04-26 12:48:37 +05:30
if ENV['SIMPLECOV']
require 'simplecov'
end
2014-09-02 18:07:02 +05:30
2015-04-26 12:48:37 +05:30
if ENV['COVERALLS']
2014-09-02 18:07:02 +05:30
require 'coveralls'
2015-04-26 12:48:37 +05:30
Coveralls.wear_merged!
2014-09-02 18:07:02 +05:30
end
ENV['RAILS_ENV'] = 'test'
require './config/environment'
require 'rspec/expectations'
require 'sidekiq/testing/inline'
2015-09-11 14:41:01 +05:30
require_relative 'capybara'
require_relative 'db_cleaner'
2014-09-02 18:07:02 +05:30
%w(select2_helper test_env repo_helpers).each do |f|
require Rails.root.join('spec', 'support', f)
end
2015-09-11 14:41:01 +05:30
Dir["#{Rails.root}/features/steps/shared/*.rb"].each { |file| require file }
2014-09-02 18:07:02 +05:30
WebMock.allow_net_connect!
Spinach.hooks.before_run do
2015-04-26 12:48:37 +05:30
include RSpec::Mocks::ExampleMethods
2015-09-11 14:41:01 +05:30
RSpec::Mocks.setup
2014-09-02 18:07:02 +05:30
TestEnv.init(mailer: false)
2015-09-25 12:07:36 +05:30
# skip pre-receive hook check so we can use
# web editor and merge
TestEnv.disable_pre_receive
2014-09-02 18:07:02 +05:30
include FactoryGirl::Syntax::Methods
end