spec/spec_helper.rb in rate_limiter-0.0.3 vs spec/spec_helper.rb in rate_limiter-0.0.4

- old
+ new

@@ -1,6 +1,30 @@ # encoding: utf-8 -require 'rails/railtie' -require 'active_record' +ENV['RAILS_ENV'] = 'test' -require 'rate_limiter' +require File.expand_path('../dummy/config/environment.rb', __FILE__) +require 'rspec/rails' +require 'shoulda/matchers/integrations/rspec' +require 'capybara/rspec' +require 'database_cleaner' + +Rails.backtrace_cleaner.remove_silencers! + +Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } + +RSpec.configure do |config| + config.mock_with :rspec + + config.before :suite do + DatabaseCleaner.strategy = :transaction + DatabaseCleaner.clean_with :truncation + end + + config.before :each do + DatabaseCleaner.start + end + + config.after :each do + DatabaseCleaner.clean + end +end