debian-mirror-gitlab/spec/spec_helper.rb

42 lines
1 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'
# 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
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
2014-09-02 18:07:02 +05:30
config.include TestEnv
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
ActiveRecord::Migration.maintain_test_schema!