As I continue to learn my way around TDD with RSpec 2 and Rails 3.1, I can't seem to find a solution to this problem.
I have a Users controller with a new and create action. In my UsersController spec, I have
users_controller_spec.rb
describe "POST 'create'" do
before(:each) do
@attr = Factory.attributes_for(:user)
end
it "should assign an @user variable" do
post :create, :user => @attr
assigns[:user].should_not be_nil
assigns[:user].should be_kind_of(User)
end
end
and in my UsersController,
users_controller.rb
def create
@user = User.new(params[:user])
end
This spec is failing with
1) UsersController POST 'create' should assign an @user variable
Failure/Error: post :create, :user => @attr
ActionView::MissingTemplate:
I can continue to implement application code to get this test to pass, but I feel like this test should be passing as it is.
Any suggestions?