Monday, January 6, 2014

[Rails] Re: Problems testing a destroy failure

That was my original attempt too but the require_user_payment_info
before_filter method checks for a valid payment_info object and will
redirect away from the delete method if the @payment_info object isn't
valid. If I mock the @payment_info object to be invalid, it won't
make it to the delete method.

I must admit my mocking knowledge isn't very strong so my attempts at
mocking have been failures.

Here's the before_filter configuration for require_user_payment_info:

before_filter :require_user_payment_info, :only => [:show, :edit,
:update, :delete]

--
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/014137f89f7cbdfc0e08c427fe1902e0%40ruby-forum.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