force response body to be read in assert_template #5288

Merged
merged 1 commit into from Mar 5, 2012

Projects

None yet

4 participants

@lest
Contributor
lest commented Mar 5, 2012

Original issue #1743

@josevalim josevalim commented on an outdated diff Mar 5, 2012
actionpack/lib/action_controller/test_case.rb
@@ -69,6 +69,8 @@ def process(*args)
# assert_template :partial => '_customer', :locals => { :customer => @customer }
#
def assert_template(options = {}, message = nil)
+ response.body # force body to be readed
@josevalim
josevalim Mar 5, 2012 Member

What if we change this comment to:

# Force body to be read in case the
# template is being streamed.
@josevalim josevalim merged commit 9cd9276 into rails:master Mar 5, 2012
@kylev
kylev commented Jan 17, 2013

This doesn't appear to be fixed on 3-2-stable. It currently affecting my 3.2.11 application. Can it be back-ported?

@kylev kylev referenced this pull request in rspec/rspec-rails Jan 17, 2013
Closed

render_template fails when streaming is active (Rails 3.2) #673

@carlosantoniodasilva

@kylev backported in a5013bb, should be out in the next 3.2 release. Thanks.

@kylev
kylev commented Jan 17, 2013

This may actually be insufficient. I'm investigating, but it looks like it'll fail if you have both a :template and :layout with :stream => true. It looks like assert_template will find the layout.

@carlosantoniodasilva

@kylev alright, if you find any fixes, please feel free to send a pull request. Thanks!

@kylev
kylev commented Jan 18, 2013

Narrowing my bug, it may actually relate to Slim instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment