2015-07-14 02:41:47 +00:00
|
|
|
if ENV['SIMPLECOV']
|
|
|
|
require 'simplecov'
|
|
|
|
SimpleCov.start :rails
|
|
|
|
end
|
|
|
|
|
2014-09-19 13:39:56 +00:00
|
|
|
ENV["RAILS_ENV"] ||= 'test'
|
2015-07-14 02:41:47 +00:00
|
|
|
|
2014-09-19 13:39:56 +00:00
|
|
|
require File.expand_path("../../config/environment", __FILE__)
|
2014-03-13 22:34:12 +00:00
|
|
|
require 'rspec/rails'
|
2015-06-10 05:38:36 +00:00
|
|
|
require 'shoulda/matchers'
|
2014-03-13 22:34:12 +00:00
|
|
|
require 'sidekiq/testing/inline'
|
2015-11-12 09:52:20 +00:00
|
|
|
require 'rspec/retry'
|
2016-05-22 01:17:15 +00:00
|
|
|
|
2016-06-08 09:43:13 +00:00
|
|
|
if ENV['CI']
|
|
|
|
require 'knapsack'
|
|
|
|
Knapsack::Adapters::RSpecAdapter.bind
|
|
|
|
end
|
2014-03-13 22:34:12 +00:00
|
|
|
|
|
|
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
|
|
|
# in spec/support/ and its subdirectories.
|
2015-04-25 18:33:04 +00:00
|
|
|
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
2014-03-13 22:34:12 +00:00
|
|
|
|
|
|
|
RSpec.configure do |config|
|
2014-06-06 17:55:49 +00:00
|
|
|
config.use_transactional_fixtures = false
|
|
|
|
config.use_instantiated_fixtures = false
|
2014-03-13 22:34:12 +00:00
|
|
|
config.mock_with :rspec
|
|
|
|
|
2015-11-12 09:52:20 +00:00
|
|
|
config.verbose_retry = true
|
|
|
|
config.display_try_failure_messages = true
|
|
|
|
|
2014-03-13 22:34:12 +00:00
|
|
|
config.include Devise::TestHelpers, type: :controller
|
2015-06-29 00:16:10 +00:00
|
|
|
config.include LoginHelpers, type: :feature
|
|
|
|
config.include LoginHelpers, type: :request
|
2015-06-29 19:04:57 +00:00
|
|
|
config.include StubConfiguration
|
2016-02-12 14:58:39 +00:00
|
|
|
config.include EmailHelpers
|
2015-09-06 16:42:39 +00:00
|
|
|
config.include RelativeUrl, type: feature
|
2014-03-13 22:34:12 +00:00
|
|
|
config.include TestEnv
|
2015-11-30 09:21:10 +00:00
|
|
|
config.include ActiveJob::TestHelper
|
2015-09-09 11:37:50 +00:00
|
|
|
config.include StubGitlabCalls
|
|
|
|
config.include StubGitlabData
|
2015-06-29 00:16:10 +00:00
|
|
|
|
2015-02-12 15:48:53 +00:00
|
|
|
config.infer_spec_type_from_file_location!
|
2015-02-12 18:17:35 +00:00
|
|
|
config.raise_errors_for_deprecations!
|
2014-03-13 22:34:12 +00:00
|
|
|
|
|
|
|
config.before(:suite) do
|
2014-07-31 16:24:53 +00:00
|
|
|
TestEnv.init
|
2014-03-13 22:34:12 +00:00
|
|
|
end
|
2013-03-26 09:13:30 +00:00
|
|
|
end
|
2015-03-27 19:31:16 +00:00
|
|
|
|
2015-10-05 10:02:26 +00:00
|
|
|
FactoryGirl::SyntaxRunner.class_eval do
|
|
|
|
include RSpec::Mocks::ExampleMethods
|
|
|
|
end
|
|
|
|
|
2015-03-27 19:31:16 +00:00
|
|
|
ActiveRecord::Migration.maintain_test_schema!
|