debian-mirror-gitlab/spec/spec_helper.rb

60 lines
1.5 KiB
Ruby
Raw Normal View History

2015-04-26 12:48:37 +05:30
if ENV['SIMPLECOV']
require 'simplecov'
2015-09-11 14:41:01 +05:30
SimpleCov.start :rails
2015-04-26 12:48:37 +05:30
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
2015-04-26 12:48:37 +05:30
ENV["RAILS_ENV"] ||= 'test'
2015-09-11 14:41:01 +05:30
2015-04-26 12:48:37 +05:30
require File.expand_path("../../config/environment", __FILE__)
2014-09-02 18:07:02 +05:30
require 'rspec/rails'
2015-09-11 14:41:01 +05:30
require 'shoulda/matchers'
2014-09-02 18:07:02 +05:30
require 'sidekiq/testing/inline'
2016-06-02 11:05:42 +05:30
require 'rspec/retry'
2014-09-02 18:07:02 +05:30
if ENV['CI']
require 'knapsack'
Knapsack::Adapters::RSpecAdapter.bind
end
2014-09-02 18:07:02 +05:30
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
2015-09-11 14:41:01 +05:30
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
2014-09-02 18:07:02 +05:30
RSpec.configure do |config|
config.use_transactional_fixtures = false
config.use_instantiated_fixtures = false
config.mock_with :rspec
2016-06-02 11:05:42 +05:30
config.verbose_retry = true
config.display_try_failure_messages = true
2014-09-02 18:07:02 +05:30
config.include Devise::TestHelpers, type: :controller
2015-09-11 14:41:01 +05:30
config.include LoginHelpers, type: :feature
config.include LoginHelpers, type: :request
config.include StubConfiguration
2016-06-02 11:05:42 +05:30
config.include EmailHelpers
2015-09-25 12:07:36 +05:30
config.include RelativeUrl, type: feature
2014-09-02 18:07:02 +05:30
config.include TestEnv
2015-12-23 02:04:40 +05:30
config.include ActiveJob::TestHelper
2015-09-25 12:07:36 +05:30
config.include StubGitlabCalls
config.include StubGitlabData
2015-09-11 14:41:01 +05:30
2015-04-26 12:48:37 +05:30
config.infer_spec_type_from_file_location!
config.raise_errors_for_deprecations!
2014-09-02 18:07:02 +05:30
config.before(:suite) do
TestEnv.init
end
end
2015-04-26 12:48:37 +05:30
2015-10-24 18:46:33 +05:30
FactoryGirl::SyntaxRunner.class_eval do
include RSpec::Mocks::ExampleMethods
end
2015-04-26 12:48:37 +05:30
ActiveRecord::Migration.maintain_test_schema!