diff options
Diffstat (limited to 'spec/support/matchers/navigation_matcher.rb')
-rw-r--r-- | spec/support/matchers/navigation_matcher.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/support/matchers/navigation_matcher.rb b/spec/support/matchers/navigation_matcher.rb new file mode 100644 index 00000000000..63f59b9654c --- /dev/null +++ b/spec/support/matchers/navigation_matcher.rb @@ -0,0 +1,12 @@ +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| + expect(page.find('.sidebar-sub-level-items > li.active:not(.fly-out-top-item)')).to have_content(expected) + end +end |