menu_items_spec.rb 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. require 'rails_helper'
  2. RSpec.describe 'Public Knowledge Base menu items', type: :system, authenticated_as: false do
  3. include_context 'basic Knowledge Base'
  4. include_context 'Knowledge Base menu items'
  5. before do
  6. published_answer
  7. visit help_no_locale_path
  8. end
  9. it 'shows header public link' do
  10. expect(page).to have_css('header .menu-item', text: menu_item_1.title)
  11. end
  12. it 'shows another header public link' do
  13. expect(page).to have_css('header .menu-item', text: menu_item_2.title)
  14. end
  15. it "doesn't show footer link in header" do
  16. expect(page).to have_no_css('header .menu-item', text: menu_item_3.title)
  17. end
  18. it 'shows footer public link' do
  19. expect(page).to have_css('footer .menu-item', text: menu_item_3.title)
  20. end
  21. it "doesn't show footer link of another locale" do
  22. expect(page).to have_no_css('footer .menu-item', text: menu_item_4.title)
  23. end
  24. it 'shows public links in given order' do
  25. index_1 = page.body.index menu_item_1.title
  26. index_2 = page.body.index menu_item_2.title
  27. expect(index_1).to be < index_2
  28. end
  29. end