Here is a line from my test.rb file in the Rails 3.1.12 application:
config.action_mailer.default_url_options = config.action_controller.default_url_options = { :host => "127.0.0.1", :port => 3000 }
Now here is the test I am doing:
subject { get :success } subject.should redirect_to(:home)
This causes an error:
Failure/Error: subject.should redirect_to(:home) Expected response to be a redirect to <http:
What I did wrong? Or where is the testing host configured?
Here is the spec_helper.rb file for the full reference.
# 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 'capybara/rspec'
source share