Skip to content

Instantly share code, notes, and snippets.

@jacortinas
Forked from ogredude/spec_helper.rb
Created August 9, 2011 20:16
Show Gist options
  • Save jacortinas/1135080 to your computer and use it in GitHub Desktop.
Save jacortinas/1135080 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'spork'
Spork.prefork do
# Loading more in this block will cause your tests to run faster. However,
# if you change any configuration or code from libraries loaded here, you'll
# need to restart spork for it take effect.
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
RSpec.configure do |config|
config.mock_with :rspec
config.use_transactional_fixtures = true
# Needed for Spork
ActiveSupport::Dependencies.clear
end
end
Spork.each_run do
# This code will be run each time you run your specs.
require 'factory_girl_rails'
require 'authlogic/test_case'
require 'spec/helpers'
load "#{Rails.root}/config/routes.rb"
Dir["#{Rails.root}/app/**/*.rb"].each { |f| load f }
Rspec.configure do |config|
config.include Helpers
config.include Authlogic::TestCase
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment