-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
render_template fails when streaming is active (Rails 3.2) #673
Comments
This may be related to a actionpack bug, fixed not yet backported into the 3.2 series. |
Do you have time to apply the fix and see if it fixes your tests? Thanks! |
It doesn't seem to work. I hand-patched my locally installed ActionController::TemplateAssertions with a reference to response.body (which should start the rendering sequence enough to resolve template lookups) and the test still fails.
I'm not terribly surprised by this as it sort of makes sense that streaming output would be primed with the layout template first, and render my designated template later on in the process. But it seems like a pretty bad bug (or possibly a misunderstanding on my part) in the public contract of Interestingly, with (1) the I'm going to dig a bit more this evening (if I have time) and post findings here. Perhaps the rails side of things should be treating streamed results a bit differently. |
Still working on narrowing this down. It seems like this should pass If you want to see a completely minimal demonstration of the problem, I created a branch to demonstrate it off my "fresh" rails 3.2.x playground. |
yo @alindeman I can probably take a look at this on tuesday if that's ok with you |
That'd be awesome! Thanks for jumping in. |
Note, I've updated my repro branch to demonstrate that the same effect seems present with .erb as well as .slim templates (both of which support streaming). I also added a .haml verision that passes (HAML doesn't support streaming). The failing tests happen regardless of whether you have the |
I'm getting an epic CNR with my current dev version of rspec. shell output:
ruby version: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.0] rspec-rails version: 1d15db0 |
I've got this revision of @kylev's repo: a03589ce500269bbc661a8304eafbf906ed447d5 |
Can you repro it with the version my app specifies? |
I can, the failure trace looks like this:
This means the issue has been fixed between the current release and dev versions of rspec-rails. |
Perhaps this has to do with the new |
@kylev so it's been fixed in the dev version of rspec, I'd expect the next release to cause this issue to be fixed. @alindeman do you agree? |
Very nice. I honestly don't know exactly why |
Given rspec-rails 2.12.1 and a simple template controller:
And a related spec:
The test should succeed. Instead, it fails:
It should succeed. Removing the
stream: true
makes the test succeed.The text was updated successfully, but these errors were encountered: