summaryrefslogtreecommitdiff
path: root/spec/support/helpers/features/canonical_link_helpers.rb
blob: 6ef934a924bc47c0404c33fa8b2570bd4c766e45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 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