Show always poll officer menu to officers
Since the change on commit cbbe188d6 we added a Poll.current.any?
condition to show the officing link on admin menu to officers.
That condition doesn't have much sense since Poll results only can be
added after a poll has ended, and there may be only one active poll.
This commit is contained in:
@@ -18,7 +18,7 @@ class Layout::AdminLoginItemsComponent < ApplicationComponent
|
||||
(moderation_link if user.administrator? || user.moderator?),
|
||||
(valuation_link if feature?(:budgets) && (user.administrator? || user.valuator?)),
|
||||
(management_link if user.administrator? || user.manager?),
|
||||
(officing_link if user.poll_officer? && Poll.current.any?),
|
||||
(officing_link if user.poll_officer?),
|
||||
(sdg_management_link if feature?(:sdg) && (user.administrator? || user.sdg_manager?))
|
||||
]
|
||||
end
|
||||
|
||||
@@ -102,7 +102,7 @@ describe Layout::AdminLoginItemsComponent do
|
||||
end
|
||||
|
||||
it "shows the officing link to poll officers" do
|
||||
user = create(:poll_officer, polls: [create(:poll)]).user
|
||||
user = create(:poll_officer).user
|
||||
|
||||
render_inline Layout::AdminLoginItemsComponent.new(user)
|
||||
|
||||
|
||||
@@ -61,7 +61,6 @@ describe "Poll Officing" do
|
||||
|
||||
scenario "Access as an administrator is not authorized" do
|
||||
create(:administrator, user: user)
|
||||
create(:poll)
|
||||
login_as(user)
|
||||
|
||||
visit officing_root_path
|
||||
@@ -74,7 +73,6 @@ describe "Poll Officing" do
|
||||
scenario "Access as an administrator with poll officer role is authorized" do
|
||||
create(:administrator, user: user)
|
||||
create(:poll_officer, user: user)
|
||||
create(:poll)
|
||||
login_as(user)
|
||||
visit root_path
|
||||
|
||||
@@ -87,7 +85,6 @@ describe "Poll Officing" do
|
||||
|
||||
scenario "Access as a poll officer is authorized" do
|
||||
create(:poll_officer, user: user)
|
||||
create(:poll)
|
||||
login_as(user)
|
||||
visit root_path
|
||||
|
||||
|
||||
Reference in New Issue
Block a user