Skip to content

Instantly share code, notes, and snippets.

@joefiorini
Created January 31, 2012 23:06
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 joefiorini/1713659 to your computer and use it in GitHub Desktop.
Save joefiorini/1713659 to your computer and use it in GitHub Desktop.
--colour -r turnip -fd
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
require 'turnip/capybara'
require 'capybara/webkit'
require 'database_cleaner'
solr_started = false
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
driver = (ENV["DRIVER"] || :webkit).to_sym
Capybara.javascript_driver = driver
RSpec.configure do |config|
# == Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
#
config.mock_with :rspec
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.alias_it_should_behave_like_to :it_has, 'has'
config.treat_symbols_as_metadata_keys_with_true_values = true
config.include ActivityStepsHelper, :turnip
config.include ActionController::RecordIdentifier, :turnip
config.include Rails.application.routes.url_helpers, :turnip
config.include Rack::Test::Methods, :api
config.include RackTestExt, :api
config.filter_run_excluding :wip, :backlog
# If you're not using ActiveRecord, or you'd prefer not to run each of your
# instead of true.
# examples within a transaction, remove the following line or assign false
DatabaseCleaner.strategy = :truncation
config.before do
Sunspot.remove_all!
DatabaseCleaner.start
end
config.after do
DatabaseCleaner.clean
end
# If true, the base class of anonymous controllers will be inferred
# automatically. This will be the default behavior in future versions of
# rspec-rails.
config.infer_base_class_for_anonymous_controllers = false
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment