added tests for substrings

This commit is contained in:
gaffo 2008-10-28 21:13:54 -05:00
parent 275829d382
commit 067bc791c5

View File

@ -32,6 +32,12 @@ describe Webrat::Link do
link.matches_text?("Link Text").should == 0 link.matches_text?("Link Text").should == 0
end end
it "should matches_text? on substring" do
link = Webrat::Link.new(@session, nil)
link.should_receive(:text).and_return("Link Text")
link.matches_text?("nk Te").should_not be_nil
end
it "should not matches_text? on link_text case insensitive" do it "should not matches_text? on link_text case insensitive" do
link = Webrat::Link.new(@session, nil) link = Webrat::Link.new(@session, nil)
link.should_receive(:text).and_return("Link Text") link.should_receive(:text).and_return("Link Text")