2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
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
|
2020-08-26 12:31:33 +00:00
|
|
|
expect(page).to have_no_css('header .menu-item', text: menu_item_3.title)
|
2020-05-13 17:01:42 +00:00
|
|
|
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
|
2020-08-26 12:31:33 +00:00
|
|
|
expect(page).to have_no_css('footer .menu-item', text: menu_item_4.title)
|
2020-05-13 17:01:42 +00:00
|
|
|
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
|