GeeCON Prague 2014*
The moose likes Ruby and the fly likes Problems testing a destroy failure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Languages » Ruby
Bookmark "Problems testing a destroy failure" Watch "Problems testing a destroy failure" New topic
Author

Problems testing a destroy failure

Eric Hermann
Greenhorn

Joined: May 07, 2013
Posts: 6
Hello,
I'm trying to test an active record object destroy failure but I'm having problems creating a failure situation. I have a before_filter method called 'require_user_payment_info' which validates the @payment_info object before the delete method is called so I can't create a 'bad' @payment_info object before the delete method is called.

Here's the require_user_payment_info method:




And the actual delete method:



Any ideas?

Thanks!
Eric Hermann
Greenhorn

Joined: May 07, 2013
Posts: 6
Bingo - here's my solution:



Thanks for your help!
 
GeeCON Prague 2014
 
subject: Problems testing a destroy failure