Permalink
Browse files

Make assert_template failure message more friendly

Signed-off-by: Joshua Peek <josh@joshpeek.com>
  • Loading branch information...
1 parent dc66469 commit 8d72b82b8da99eda9ba654b3d3a4da847a212406 @packagethief packagethief committed with josh Aug 5, 2008
Showing with 2 additions and 2 deletions.
  1. +2 −2 actionpack/lib/action_controller/assertions/response_assertions.rb
View
4 actionpack/lib/action_controller/assertions/response_assertions.rb
@@ -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

0 comments on commit 8d72b82

Please sign in to comment.