diff --git a/lib/webrat/core/matchers/have_content.rb b/lib/webrat/core/matchers/have_content.rb index 11f90923..d4cc1e6a 100644 --- a/lib/webrat/core/matchers/have_content.rb +++ b/lib/webrat/core/matchers/have_content.rb @@ -54,13 +54,15 @@ def contain(content) # Asserts that the body of the response contain # the supplied string or regexp def assert_contain(content) - assert(contain(content)) + hc = HasContent.new(content) + assert(hc.matches?(content), hc.failure_message) end # Asserts that the body of the response # does not contain the supplied string or regepx def assert_not_contain(content) - assert(!contain(content)) + hc = HasContent.new(content) + assert(!hc.matches?(content), hc.negative_failure_message) end end