Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

51 lines (43 sloc) 1.429 kb
require "spork"
require "factory_girl"
require "test/unit"
if RUBY_PLATFORM =~ /darwin/
require "spork/ext/ruby-debug"
end
ENV["RAILS_ENV"] ||= "test"
abort("RAILS_ENV != test") unless ENV["RAILS_ENV"] == "test"
Spork.prefork do
require File.expand_path("../../config/environment", __FILE__)
require "rspec/rails"
require "rspec/autorun"
require "capybara/rails"
require "database_cleaner"
require "simplecov"
require "cancan/matchers"
# SimpleCov.start "rails"
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
RSpec.configure do |config|
config.mock_with :rspec
config.use_transactional_fixtures = false
config.before(:suite) { DatabaseCleaner.strategy = :truncation }
config.before(:all) { DatabaseCleaner.start }
config.after(:all) { DatabaseCleaner.clean }
config.after(:all) { teardown }
config.infer_base_class_for_anonymous_controllers = false
config.mock_with :rspec
config.include FactoryGirl::Syntax::Methods
config.include LoginHelper
config.include UrlHelper
config.include SetupHelper
config.order = "random"
end
end
Spork.each_run do
ActiveRecord::Base.instantiate_observers
load "#{Rails.root}/config/routes.rb"
Dir["#{Rails.root}/app/**/*.rb"].each { |f| load f }
FactoryGirl.factories.clear
FactoryGirl.sequences.clear
FactoryGirl.traits.clear
load "#{::Rails.root}/spec/factories.rb"
end
Jump to Line
Something went wrong with that request. Please try again.