You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then I will caught in an error complains that "response does not have method body" . It turns out that the assert_template method in test_case.rb file under actionpack/lib add a new line calling the body method of response.
//Force body to be read in case the template is being streamed
response.boy
I finally give up use this way to assert the rendered template, instead, i assert whether the element shows up in the rendered partial.
GIven if I want continue to use render_template in haml templates tests, do I have any other way to avoid that or how could covert the pure string into an http response?
The text was updated successfully, but these errors were encountered:
I find, that it's better to test functionality: I.e. id the correct content show up on the complete, rendered template, than to test implementation: Was the template included in a particular maner.
But, when that's said, I'm using haml, and I have never had problems using rspec and the render_template matcher. What version of rails, rspec and haml are you using?
Sorry, it's been like 2 months ago, I can't remember that much. This thing happens when I tried to use render_template method when testing haml template instead of testing controller to render certain template. The problem is solved. Should I close the issue?
hi, just upgrade to latest rails distribution and found this issue.
I am testing template that rendering another partial in haml test file, and the test is like this:
render
rendered.should render_template('template_name')
Then I will caught in an error complains that "response does not have method body" . It turns out that the assert_template method in test_case.rb file under actionpack/lib add a new line calling the body method of response.
//Force body to be read in case the template is being streamed
response.boy
I finally give up use this way to assert the rendered template, instead, i assert whether the element shows up in the rendered partial.
GIven if I want continue to use render_template in haml templates tests, do I have any other way to avoid that or how could covert the pure string into an http response?
The text was updated successfully, but these errors were encountered: