1234567891011121314151617181920212223242526272829303132333435363738 |
- require 'rails_helper'
- RSpec.describe 'Public Knowledge Base menu items', type: :system, authenticated: false do
- include_context 'basic Knowledge Base'
- include_context 'Knowledge Base menu items'
- before do
- published_answer
- visit help_no_locale_path
- end
- it 'shows header public link' do
- expect(page).to have_css('header .menu-item', text: menu_item_1.title)
- end
- it 'shows another header public link' do
- expect(page).to have_css('header .menu-item', text: menu_item_2.title)
- end
- it "doesn't show footer link in header" do
- expect(page).not_to have_css('header .menu-item', text: menu_item_3.title)
- end
- it 'shows footer public link' do
- expect(page).to have_css('footer .menu-item', text: menu_item_3.title)
- end
- it "doesn't show footer link of another locale" do
- expect(page).not_to have_css('footer .menu-item', text: menu_item_4.title)
- end
- it 'shows public links in given order' do
- index_1 = page.body.index menu_item_1.title
- index_2 = page.body.index menu_item_2.title
- expect(index_1).to be < index_2
- end
- end
|