debian-mirror-gitlab/spec/support/helpers/features/canonical_link_helpers.rb
2023-06-20 00:43:36 +05:30

22 lines
506 B
Ruby

# frozen_string_literal: true
# These helpers allow you to manipulate with notes.
#
# Usage:
# describe "..." do
# include Features::CanonicalLinkHelpers
# ...
#
# expect(page).to have_canonical_link(url)
#
module Features
module CanonicalLinkHelpers
def have_canonical_link(url)
have_xpath("//link[@rel=\"canonical\" and @href=\"#{url}\"]", visible: false)
end
def have_any_canonical_links
have_xpath('//link[@rel="canonical"]', visible: false)
end
end
end