diff --git a/spec/features/has_one_spec.rb b/spec/features/has_one_spec.rb index 22a55d2..8cda99b 100644 --- a/spec/features/has_one_spec.rb +++ b/spec/features/has_one_spec.rb @@ -78,6 +78,10 @@ def heading_tag_name heading.tag_name end + + def named?(name) + heading.has_text?(name) + end end def section_heading_tag_name @@ -89,6 +93,7 @@ def section_heading_tag_name expect(test_page.section.heading_tag_name).to eq("h2") expect(test_page.section_heading_tag_name).to eq("h2") + expect(test_page.section).to be_named("Section Heading") end it "behaves as Capybara would when there's an ambiguous match" do @@ -110,7 +115,7 @@ def section_heading_tag_name expect { test_page.list.item }.to raise_error(Capybara::Ambiguous) end - it "allows for passing arguments to carry through to Capybara arguments" do + it "allows for passing positional arguments to carry through to Capybara arguments" do page = build_page(<<-HTML)