Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

99 lines (77 sloc) 2.683 kB
require 'simplecov'
SimpleCov.start
require 'spork'
Spork.prefork do
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require 'rails/application'
Spork.trap_method(Rails::Application::RoutesReloader, :reload!) # Rails 3.1
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
require 'shoulda-matchers'
require 'webmock'
OmniAuth.config.test_mode = true
WebMock.disable_net_connect! :allow_localhost => true
# To run specs headless, use :webkit driver:
Capybara.javascript_driver = :webkit
if ENV['POLTERGEIST']
require 'capybara/poltergeist'
Capybara.javascript_driver = :poltergeist
end
# 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}
RSpec.configure do |config|
config.treat_symbols_as_metadata_keys_with_true_values = true
# ## 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"
# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, remove the following line or assign false
# instead of true.
config.use_transactional_fixtures = false
# Database Cleaner
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
config.before(:each, :js => true) do
DatabaseCleaner.strategy = :truncation
end
config.before(:each) do
DatabaseCleaner.start
end
config.after(:each) 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
config.include FactoryGirl::Syntax::Methods
config.include Capybara::DSL
end
end
Spork.each_run do
FactoryGirl.reload
I18n.backend.reload!
RSpec.configure do |config|
config.before do
User.any_instance.stub(:estimate_skills).and_return(nil)
Twitter::Client.any_instance.stub(:update)
Timecop.travel(Date.parse('12/12/2012'))
end
config.after do
Timecop.return
end
end
end
Jump to Line
Something went wrong with that request. Please try again.