debian-mirror-gitlab/spec/support/helpers/features/canonical_link_helpers.rb
2021-01-30 21:13:32 +05:30

28 lines
656 B
Ruby

# frozen_string_literal: true
# These helpers allow you to manipulate with notes.
#
# Usage:
# describe "..." do
# include Spec::Support::Helpers::Features::CanonicalLinkHelpers
# ...
#
# expect(page).to have_canonical_link(url)
#
module Spec
module Support
module Helpers
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
end
end
end