I'm running rails 3.2.11 and ruby 1.9.3
How I implemented it: I open a terminal window and run:
spork
Here is the message I get:
Using RSpec, Rails
Preloading Rails environment
Loading Spork.prefork block...
Rack::File headers parameter replaces cache_control after Rack 1.5.
Spork is ready and listening on 8989!
I open a separate terminal and run autotest.
Autotest is still slow.(2 mn 47 seconds for 263 examples)
I am only running controller and model tests.
Here is my spec_helper:
require 'rubygems'
require 'spork'
#uncomment the following line to use spork with the debugger
require 'spork/ext/ruby-debug'
Spork.prefork do
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
require 'capybara/rails'
require 'capybara/rspec'
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
RSpec.configure do |config|
config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.use_transactional_fixtures = true
config.infer_base_class_for_anonymous_controllers = false
config.order = "random"
Capybara.register_driver :selenium do |app|
Capybara::Selenium::Driver.new(app, :browser => :chrome)
end
Capybara.app_host = "#{FULL_ROOT}"
def test_sign_in(user)
session[:user_id] = user.id
end
end
end
Spork.each_run do
# This code will be run each time you run your specs.
end