Andrew Kaspick
2007-Feb-27 01:00 UTC
@html_document not being reset with a post_via_redirect
Hello, I''m not sure if I have found a bug or if what I''m seeing is expected behaviour. I''m using the new assert_select methods which use the instance var @html_document found in action_controller/test_process.rb My integration test does mutiple requests in a test and when using post_via_redirect, the @html_document variable isn''t being set back to nil to reparse the redirected response. I''m pretty sure line... @html_document = nil unless %w(cookies assigns).include?(method) in action_controller/integration.rb is the culprit. Am I correct in assuming this is a bug? Or am I doing something wrong? I know I could split my test up so that this additional post call occurs first in a new test, but I''d rather keep the requests in one test method. I''m currently getting around this issue, by directly setting @html_document = nil before my post_via_redirect call, but of course this isn''t ideal. Thanks, Andrew --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Andrew Kaspick
2007-Feb-27 01:04 UTC
Re: @html_document not being reset with a post_via_redirect
I can also get around this by splitting up my post_via_redirect call into a ''post'' followed by a ''follow_redirect!'', which is maybe what I should be doing?? Andrew On 2/26/07, Andrew Kaspick <akaspick@gmail.com> wrote:> Hello, > > I''m not sure if I have found a bug or if what I''m seeing is expected behaviour. > > I''m using the new assert_select methods which use the instance var > @html_document found in action_controller/test_process.rb > > My integration test does mutiple requests in a test and when using > post_via_redirect, the @html_document variable isn''t being set back to > nil to reparse the redirected response. > > I''m pretty sure line... > @html_document = nil unless %w(cookies assigns).include?(method) > in action_controller/integration.rb is the culprit. > > Am I correct in assuming this is a bug? Or am I doing something > wrong? I know I could split my test up so that this additional post > call occurs first in a new test, but I''d rather keep the requests in > one test method. > > I''m currently getting around this issue, by directly setting > @html_document = nil before my post_via_redirect call, but of course > this isn''t ideal. > > Thanks, > Andrew >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---