Hi guys and thanks a lot.

post 'account/forgot', :user => {:email => '[email protected]'}

is the deal. Patrick, if you could figure this out by putting print 
statements in your controller you're a better Rails coder than me :-) 
Did you mean:

 def forgot
    puts "OPTIONS: " + options[:user] #method undefined!
    etc etc
    .
    .
    .
 end

?

@Phlip: The thing is, this is an integration test. And because this is 
an integration test (it is meant to mimic a real-life user's interaction 
with the app) I would mean it is OK to have GET and POST inside one 
test. (In real life, I first GET the "forgot password" view by clicking 
a link. Then, I POST my email to that view, etc. I could split these two 
actions into two separate tests and then combine them under a third test 
by calling the first one, then the second one. But, the flow would be 
exactly the same as if the two were inside a single test! This is why I 
think it is not necessary to make the test more atomic than it is - as 
long as it covers one distinct "scenario" of user-app interaction).

What I do when I need to see the errors I get (those who result in 
failures and errors in my test) is use this statement which I find very 
productive:

assert_response :success, "Errors on model: #any assert statement can be 
used
#{assigns(:my_model).errors.full_messages.to_sentence}"

That way, the errors appear in the terminal window that I run my 
commands from.

Hope this helps!

Cheers, Vahagn
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to