test/test_helper.rb
# Make the Capybara DSL available in all integration tests
Make the Capybara DSL available in all integration tests
Make the Capybara DSL available in all integration tests
def assert_has_published_dates(first_published = nil, last_updated = nil, history_link: false)
    text = []
    text << first_published if first_published
    text << last_updated if last_updated
    within ".app-c-published-dates:last-of-type" do
      assert page.has_text?(text.join("\n")), "Published dates #{text.join("\n")} not found"
      if history_link
        assert page.has_link?("see all updates", href: "#history"), "Updates link not found"
      end
    end
  end
def assert_has_published_dates ( first_published = nil , last_updated = nil , history_link : false ) text = [ ] text << first_published if first_published text << last_updated if last_updated within ".app-c-published-dates:last-of-type" do assert page . has_text? ( text . join ( "\n" ) ) , "Published dates #{text.join("\n")} not found" if history_link assert page . has_link? ( "see all updates" , href : "#history" ) , "Updates link not found" end end end
Make the Capybara DSL available in all integration tests
Make the Capybara DSL available in all integration tests
first_published
last_updated
history_link