Skip to content

Commit

Permalink
Make assert_template failure message more friendly
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Peek <josh@joshpeek.com>
  • Loading branch information
packagethief authored and josh committed Aug 5, 2008
1 parent dc66469 commit 8d72b82
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ def assert_redirected_to(options = {}, message=nil)
#
def assert_template(expected = nil, message=nil)
clean_backtrace do
rendered = @response.rendered_template
rendered = @response.rendered_template.to_s
msg = build_message(message, "expecting <?> but rendering with <?>", expected, rendered)
assert_block(msg) do
if expected.nil?
@response.rendered_template.nil?
@response.rendered_template.blank?
else
rendered.to_s.match(expected)
end
Expand Down

0 comments on commit 8d72b82

Please sign in to comment.