2020-05-13 17:01:42 +00:00
|
|
|
require 'rails_helper'
|
|
|
|
|
2020-06-18 11:51:25 +00:00
|
|
|
RSpec.describe 'Public Knowledge Base menu items', type: :system, authenticated_as: false do
|
2020-05-13 17:01:42 +00:00
|
|
|
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
|