Why does the following method, use the first rendered file and not the last?
# returns the template path of the file which was used to
# render this response (or nil)
template.first_render.split('/').last || template.first_render
Currently I'm using assert_template which calls this method and I do
a render_to_string in the action I'm testing before the actions view
is rendered, so assert_template is saying the template that's being
rendered is the one from render_to_string, which is not what I want.
Is it looking at the first rendered file because the last file could
be a partial rendered in the view for example?
@code = render_to_string :partial => 'blah'
render :action => 'other_action'
assert_template says the rendered template is 'blah' and not 'other_action'.
Is this a bug in assert_template? I would think it should ignore the
file being rendered from render_to_string.