impressionist/tests/test_app/spec/spec_helper.rb

44 lines
934 B
Ruby
Raw Normal View History

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'
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|
# 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
# 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
# make the rails logger usable in the tests as logger.xxx "..."
def logger
Rails.logger
end
2011-02-04 04:13:41 +00:00
end