From 4381af073dd0bfa204576b9aa89343d058c2b516 Mon Sep 17 00:00:00 2001 From: Jonas Nicklas Date: Sat, 19 Dec 2009 14:19:41 +0100 Subject: [PATCH] Added more specs for has_content? --- spec/dsl/has_content_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/dsl/has_content_spec.rb b/spec/dsl/has_content_spec.rb index 4fc05d07..8bb7be93 100644 --- a/spec/dsl/has_content_spec.rb +++ b/spec/dsl/has_content_spec.rb @@ -15,6 +15,19 @@ module HasContentSpec end end + it "should be false if scoped to an element which does not have the content" do + @session.visit('/with_html') + @session.within("//a[@title='awesome title']") do + @session.should_not have_content('monkey') + end + end + + it "should ignore tags" do + @session.visit('/with_html') + @session.should_not have_content('exercitation ullamco laboris') + @session.should have_content('exercitation ullamco laboris') + end + it "should be false if the given content is not on the page" do @session.visit('/with_html') @session.should_not have_content('xxxxyzzz')