From b602ffd41cf5f11248165a15513a71f876dee2e7 Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 4 Dec 2024 09:56:31 +0300 Subject: [PATCH] Fix spec --- spec/features/menu_items/top_menu_item_spec.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/spec/features/menu_items/top_menu_item_spec.rb b/spec/features/menu_items/top_menu_item_spec.rb index e25d4c3e8705..99ed9849a026 100644 --- a/spec/features/menu_items/top_menu_item_spec.rb +++ b/spec/features/menu_items/top_menu_item_spec.rb @@ -67,7 +67,7 @@ def click_link_in_open_menu(title) end describe "Modules" do - let!(:top_menu) { find("[title=#{I18n.t('label_modules')}]") } + let(:top_menu) { find("[title=#{I18n.t('label_modules')}]") } shared_let(:menu_link_item) { Struct.new(:label, :path) } @@ -138,6 +138,14 @@ def click_link_in_open_menu(title) context "as an anonymous user" do let(:user) { create(:anonymous) } + context "when login_required", with_settings: { login_required: true } do + let(:open_menu) { false } + + it "redirects to login" do + expect(page).to have_current_path /login/ + end + end + context "when not login_required", with_settings: { login_required: false } do it "displays only projects, activity and news" do has_menu_items? project_item, activity_item, news_item