Hi,
I want to test the user controller, how can i do
the code is
if @user.save
redirect_to :action => "confirm"
else
.....
test
user = User.new(:email => "[email protected]",
:password => "12345",
:name => "you")
post :create
user.should_receive(:save).and_return(true)
response.should redirect_to('confirm')
the error
1) UsersController GET create should save redirect to confirm
Failure/Error: response.should redirect_to(:action => 'confirm')
Expected response to be a <:redirect>, but was <200>.
Expected block to return true value.
please help
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.