Skip to content

Commit

Permalink
Fix spec
Browse files Browse the repository at this point in the history
  • Loading branch information
top4ek committed Dec 4, 2024
1 parent c5cf9d5 commit b602ffd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion spec/features/menu_items/top_menu_item_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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) }

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b602ffd

Please sign in to comment.