debian-mirror-gitlab/spec/support/matchers/navigation_matcher.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
494 B
Ruby
Raw Permalink Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2018-03-17 18:26:18 +05:30
RSpec::Matchers.define :have_active_navigation do |expected|
match do |page|
expect(page).to have_selector('.sidebar-top-level-items > li.active', count: 1)
expect(page.find('.sidebar-top-level-items > li.active')).to have_content(expected)
end
end
RSpec::Matchers.define :have_active_sub_navigation do |expected|
match do |page|
2020-01-01 13:55:28 +05:30
expect(page).to have_css('.sidebar-sub-level-items > li.active:not(.fly-out-top-item)', text: expected)
2018-03-17 18:26:18 +05:30
end
end