allpro/spec/spec_helper.rb

45 lines
1.1 KiB
Ruby
Raw Permalink Normal View History

2013-08-04 19:35:10 -04:00
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
require 'capybara/rspec'
2013-08-11 01:11:13 -04:00
require 'coveralls'
2013-08-04 19:35:10 -04:00
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
2013-08-11 01:11:13 -04:00
Coveralls.wear!
2013-08-04 19:35:10 -04:00
RSpec.configure do |config|
# ## Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
config.fixture_path = "#{::Rails.root}/spec/fixtures"
2013-08-10 02:31:46 -04:00
config.use_transactional_fixtures = false
2013-08-04 19:35:10 -04:00
config.infer_base_class_for_anonymous_controllers = false
config.order = "random"
config.before(:suite) do
Capybara.javascript_driver = :webkit #:webkit, #selenium
2013-08-04 19:35:10 -04:00
DatabaseCleaner.strategy = :truncation
end
config.before(:each) do
DatabaseCleaner.start
end
config.after(:each) do
DatabaseCleaner.clean
end
end