Monday, January 6, 2014

[Rails] Re: Problems testing a destroy failure



On Monday, January 6, 2014 4:22:03 PM UTC, Ruby-Forum.com User wrote:
I should add that this is a rails 2.3.18 (*sigh*) app.    I see what
you're saying about this code not being as RESTfully optimal as it could
be but I feel that point is diverging off the original question: "how do
I get @payment_info.destroy to fail in a test?"

I would usually stub it (using mocha, rspec etc) to return/raise as appropriate. Alternatively you could submit data that you know will fail validation

Fred

 

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ab3ae52c-89dd-4470-bb5b-c76aaadf27ed%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate