rspec/rspec-rails — Issue #468: Undefined method assigns in a controller spec.
Author: PatrickMa
Created: 2011-12-02 05:07:59+00:00
State: open

NoMethodError:
undefined method `assigns' for #

Source:

require 'spec_helper'

describe CompaniesController do

describe "GET 'new'" do
it "initiates a company" do
Company.should_receive(:new).assigns(:company)
get :new
assigns(:company).should == Company.new
end

it "returns http success" do
get :new
response.should be_success
end
end

end

Project: https://github.com/PatrickMa/hacker_story/tree/rspec_problem