-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OP#59817 Remove activity menu for anonymous users with login required #17314
base: dev
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,12 +138,6 @@ 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 | ||
it "redirects to login" do | ||
expect(page).to have_current_path /login/ | ||
end | ||
end | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please do not simply delete this test because the redirect should still work and be tested. I think you just have to set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure why :top_menu is forced before examples, but all other specs fail even if we don't open top menu there. |
||
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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though an empty array is an empty array in ruby, I would suggest not returning the empty
items
array here, but theitem_groups
array. You can do this in a way, that add&
in line 223:unless items.first&.heading?
. If you do it that way thereduce
is operating again on an empty list or containing a single item.Let me know if I should explain more in depth.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing that gives us empty menu dropdown as
unless items.first&.heading?
adds to item_groups[{:title=>nil, :items=>[]}]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a variant?