2011-02-04 04:13:41 +00:00
|
|
|
ENV["RAILS_ENV"] ||= 'test'
|
2013-07-10 01:36:10 +00:00
|
|
|
|
2012-03-12 23:20:07 +00:00
|
|
|
unless ENV['CI']
|
|
|
|
require 'simplecov'
|
|
|
|
SimpleCov.start 'rails'
|
|
|
|
end
|
2013-07-10 01:36:10 +00:00
|
|
|
|
|
|
|
require File.
|
|
|
|
expand_path("../../config/environment", __FILE__)
|
|
|
|
|
2011-02-04 04:13:41 +00:00
|
|
|
require 'rspec/rails'
|
2013-07-06 19:20:35 +00:00
|
|
|
require 'capybara/rails'
|
2011-02-04 04:13:41 +00:00
|
|
|
|
2013-07-10 01:36:10 +00:00
|
|
|
# Custom matchers and macros, etc...
|
|
|
|
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f|
|
|
|
|
require f
|
|
|
|
}
|
2011-02-04 04:13:41 +00:00
|
|
|
|
|
|
|
RSpec.configure do |config|
|
2013-07-13 01:49:07 +00:00
|
|
|
|
|
|
|
# in order to pass tags(symbols) as true values
|
|
|
|
# you need to tell rspec to do so by
|
|
|
|
config.treat_symbols_as_metadata_keys_with_true_values = true
|
|
|
|
|
2011-02-04 04:13:41 +00:00
|
|
|
config.mock_with :rspec
|
|
|
|
|
|
|
|
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
|
|
|
|
|
|
|
config.use_transactional_fixtures = true
|
2012-03-06 21:42:28 +00:00
|
|
|
|
2013-07-13 01:49:07 +00:00
|
|
|
# excludes migration tag while running app base tests
|
|
|
|
config.filter_run_excluding :migration => true
|
|
|
|
|
|
|
|
# self explanatory
|
|
|
|
# runs everything
|
|
|
|
config.run_all_when_everything_filtered = true
|
|
|
|
|
2011-11-07 19:41:51 +00:00
|
|
|
# make the rails logger usable in the tests as logger.xxx "..."
|
|
|
|
def logger
|
|
|
|
Rails.logger
|
|
|
|
end
|
2012-03-06 21:42:28 +00:00
|
|
|
|
2011-02-04 04:13:41 +00:00
|
|
|
end
|