Skip to content

Instantly share code, notes, and snippets.

@gregblass
Created March 18, 2016 10:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gregblass/b886f79b0d8e2e2015af to your computer and use it in GitHub Desktop.
Save gregblass/b886f79b0d8e2e2015af to your computer and use it in GitHub Desktop.
Capybara.javascript_driver = :webkit
Capybara::Webkit.configure do |config|
config.block_unknown_urls
config.allow_url("lvh.me")
config.allow_url("*.lvh.me")
end
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with(:deletion)
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
config.before(:each, js: true) do
DatabaseCleaner.strategy = :deletion
end
config.before(:each) do
DatabaseCleaner.start
end
config.after(:each) do
DatabaseCleaner.clean
end
end
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
abort("The Rails environment is running in production mode!") if Rails.env.production?
require 'spec_helper'
require 'rspec/rails'
Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
Dir[Rails.root.join('spec/concerns/**/*.rb')].each { |f| require f }
RSpec.configure do |config|
config.infer_base_class_for_anonymous_controllers = false
config.infer_spec_type_from_file_location!
config.use_transactional_fixtures = false
config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.before(:each) do
reset_email
end
end
ActiveRecord::Migration.maintain_test_schema!
RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.syntax = :expect
end
config.mock_with :rspec do |mocks|
mocks.syntax = :expect
mocks.verify_partial_doubles = true
end
config.example_status_persistence_file_path = "spec/examples.txt"
config.order = :random
#config.profile_examples = 10
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment