asciinema.org/spec/spec_helper.rb

61 lines
1.4 KiB
Ruby
Raw Normal View History

2013-05-27 16:26:03 +00:00
if ENV['COVERAGE']
require 'simplecov'
SimpleCov.start 'rails' do
add_group "Decorators", "app/decorators"
end
2012-04-09 18:07:34 +00:00
end
2012-04-09 16:23:28 +00:00
ENV["RAILS_ENV"] ||= 'test'
ENV['CARRIERWAVE_STORAGE_DIR_PREFIX'] ||= 'uploads/test/'
2013-05-27 16:28:01 +00:00
require File.expand_path("../../config/environment", __FILE__)
2013-05-27 16:28:01 +00:00
require 'rspec/rails'
2012-11-18 23:19:42 +00:00
require 'capybara/rspec'
require 'capybara/poltergeist'
2013-07-05 17:50:42 +00:00
require 'sidekiq/testing'
2012-11-18 23:19:42 +00:00
2012-03-08 14:00:10 +00:00
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
2013-05-27 16:28:01 +00:00
Dir[Rails.root.join("spec/shared/**/*.rb")].each { |f| require f }
Capybara.javascript_driver = :poltergeist
2013-05-27 21:44:12 +00:00
OmniAuth.config.test_mode = true
CarrierWave.configure do |config|
config.storage = :file
config.enable_processing = false
end
RSpec.configure do |config|
config.mock_with :rspec
2012-11-18 23:19:42 +00:00
config.use_transactional_fixtures = false
config.infer_base_class_for_anonymous_controllers = false
2013-06-06 15:06:02 +00:00
config.order = "random"
config.include FactoryGirl::Syntax::Methods
config.include Asciinema::FixtureHelpers
config.include Asciinema::FeatureHelpers
config.include Asciinema::ControllerMacros, :type => :controller
2013-05-27 16:28:01 +00:00
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
config.before(:each, :js => true) do
DatabaseCleaner.strategy = :truncation
end
2012-11-18 23:19:42 +00:00
config.before(:each) do
DatabaseCleaner.start
end
2012-11-18 23:19:42 +00:00
config.after(:each) do
DatabaseCleaner.clean
end
end