Commit fe44255c authored by Doug Stull's avatar Doug Stull

Merge branch 'revert-bf422ffc' into 'master'

Revert "Merge branch '228646-filter-epics-pill-count-by-visibility' into 'master'"

See merge request gitlab-org/gitlab!82728
parents 8afc60ee c31ba545
......@@ -11,7 +11,7 @@ module Groups
def relation_for_count
EpicsFinder
.new(user, group_id: group.id, state: 'opened')
.execute(skip_visibility_check: false)
.execute(skip_visibility_check: true)
end
def issuable_key
......
......@@ -10,33 +10,17 @@ RSpec.describe Groups::EpicsCountService, :use_clean_rails_memory_store_caching
subject { described_class.new(group, user) }
describe '#relation_for_count' do
context "when the user is a reporter" do
before do
group.add_reporter(user)
allow(EpicsFinder).to receive(:new).and_call_original
end
it 'uses the EpicsFinder to scope epics' do
expect(EpicsFinder)
.to receive(:new)
.with(user, group_id: group.id, state: 'opened')
subject.count
end
before do
group.add_reporter(user)
allow(EpicsFinder).to receive(:new).and_call_original
end
context "when there are confidential epics" do
let_it_be(:epic) { create(:epic, :confidential, group: group) }
context "when the user has view access to the group and its epics" do
it "filters the count by visibility" do
allow(Ability).to receive(:allowed?).and_call_original
allow(Ability).to receive(:allowed?).with(user, :read_epic, group).and_return(true)
it 'uses the EpicsFinder to scope epics' do
expect(EpicsFinder)
.to receive(:new)
.with(user, group_id: group.id, state: 'opened')
expect(group.epics.count).to eq(2)
expect(subject.count).to eq(1)
end
end
subject.count
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment