Summary: I was trying to write an IntegrationTest. I did a
post_via_redirect that ought to result in a record being deleted from my
(fixture-primed) database. The same post worked as expected in the
functional test. In the integration test, the record was not deleted.
My error: I had been using a session instance (returned by open_session,
with a couple of singleton methods) for the test. Once committed to the
session object, I issued
post_via_redirect ...
instead of
session_inst.post_via_redirect ...
The convenient way ActionController::IntegrationTest makes the post*,
get*, etc methods available blinded me to the fact that they were
façades for the same methods of an implicit session instance. So if I
wanted them to apply to a session, I had to send them to that instance.
Obvious, now that I understand it.
And of like an idiot I "simplified" that detail out of my sample code.
Sorry for the bandwidth.
— F
--
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
-~----------~----~----~----~------~----~------~--~---