This project is archived and is in readonly mode.
rescue_from changes causing issues
-
Trevor Turk
I should have attached an example error I'm receiving in my tests:
This exception should be caught as described in the test:
-
Pratik
Trevor,
Does it work if you revert that changeset ?
-
Trevor Turk
Yeah, if I vendor from this commit:
http://github.com/rails/rails/co...
(which is before the one we're talking about) then things work fine. Actually, the calendar_date_select plugin is causing some errors, but the errors that are making me think that rescue_from wasn't working are gone.
I can't guarantee that I'm doing everything the way you're supposed to, but it does look suspiciously related to that commit.
-
Pratik
This happening because you have following in your tests :
# Re-raise errors caught by the controller. class HomeController; def rescue_action(e) raise e end; end -
Pratik
- State changed from new to invalid
-
Trevor Turk
I see. Thanks very much for tracking that down.
Perhaps this would be worth mentioning as a gotcha on the next release? I'm pretty sure that the Rails generator added that stuff in there for me, so it could be that this problem would bite a lot of people.
I'll clean up my functional tests to look like what's generated with edge rails now. Thanks again.
-
Pratik
Yeah, old generators added that. I wonder if there's a clean way to throw the warning.
-
Trevor Turk
Sorry to be a bother, but I'm still not able to get this working.
I've made a new app on rails edge, and I'm able to get exceptions rescued in development mode, but the tests are still failing. Perhaps I'm doing something obvious wrong, but I can't seem to figure it out.
Here's the commit that shows what I'm doing:
http://github.com/trevorturk/rai...
...and the test results:
-
Pratik
You'll need to test it in an integration test as functional tests are
tied to a specific controller.
-
Trevor Turk
Ahh, that finally did it. Thanks again for your help, and I'm very sorry to have bothered you. I do think that this change might impact people with older applications that use generated tests, but it's easy enough to fix once you know what's going on. Thanks!