Skip to content

Instantly share code, notes, and snippets.

@xwmx
Created January 9, 2009 21:17
Show Gist options
  • Save xwmx/45284 to your computer and use it in GitHub Desktop.
Save xwmx/45284 to your computer and use it in GitHub Desktop.
def assert_layout(expected=nil, message=nil)
clean_backtrace do
layout = @response.layout ? @response.layout.split('/').last : false
msg = build_message(message, "expecting <?> but rendering with <?>", expected, layout)
assert_block(msg) do
if expected.nil?
@response.layout
else
expected == layout
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment