Revert "remove commented code and make assert_contain use a true assertion"
This reverts commit 114db434182bbf9ad5b2737d181048bab363f055.
This commit is contained in:
parent
cdd390a19d
commit
9745673f1c
|
@ -55,14 +55,14 @@ module Webrat
|
||||||
# the supplied string or regexp
|
# the supplied string or regexp
|
||||||
def assert_contain(content)
|
def assert_contain(content)
|
||||||
hc = HasContent.new(content)
|
hc = HasContent.new(content)
|
||||||
assert hc.matches?(response_body), hc.failure_message
|
raise Test::Unit::AssertionFailedError.new(hc.failure_message) unless hc.matches?(response_body)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Asserts that the body of the response
|
# Asserts that the body of the response
|
||||||
# does not contain the supplied string or regepx
|
# does not contain the supplied string or regepx
|
||||||
def assert_not_contain(content)
|
def assert_not_contain(content)
|
||||||
hc = HasContent.new(content)
|
hc = HasContent.new(content)
|
||||||
assert !hc.matches?(response_body), hc.negative_failure_message
|
raise Test::Unit::AssertionFailedError.new(hc.negative_failure_message) if hc.matches?(response_body)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -88,6 +88,7 @@ module ActionController #:nodoc:
|
||||||
IntegrationTest.class_eval do
|
IntegrationTest.class_eval do
|
||||||
include Webrat::Methods
|
include Webrat::Methods
|
||||||
include Webrat::Selenium::Methods
|
include Webrat::Selenium::Methods
|
||||||
|
# include Webrat::Matchers
|
||||||
include Webrat::Selenium::Matchers
|
include Webrat::Selenium::Matchers
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -254,7 +254,6 @@ describe Webrat::Matchers do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "asserts for contains," do
|
describe "asserts for contains," do
|
||||||
include Test::Unit::Assertions
|
|
||||||
before(:each) do
|
before(:each) do
|
||||||
should_receive(:response_body).and_return @body
|
should_receive(:response_body).and_return @body
|
||||||
require 'test/unit'
|
require 'test/unit'
|
||||||
|
|
Loading…
Reference in New Issue