On 2/16/07, Jon
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
> Has anyone found that in the testing framework, when an action is
> redirected to itself within a test, ivars that were set the first time
> through the action REMAIN SET the second time through the action (after
> the redirect)? I''m getting this behavior in Rails 1.2.1...seems
like a
> bug.
>
> For reference, the redirect is supplying different GET parameters than
> were passed in the first time, so it''s not redirecting in some
endless
> loop or anything.
>
> Thanks.
Hi Jon,
Is this a functional or integration test? For functional tests, you
would presumably be creating the controller instance in #setup, which
means you only get a fresh instance per test, and so if you run
through the same action twice in one test, the instance variables
would be lying around from the previous one.
It seems like a strange set up you''ve got there, though, where not
only are you redirecting to the same action, but it acts differently
depending on whether or not an instance variable has already been set
to something. I can only guess, but maybe it would be better to
refactor that a little?
Regards,
George.
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---