Commit 75f14919 authored by Vladimir Shushlin's avatar Vladimir Shushlin

Clean up evidence controller specs and fix one

Currently we don't show issues in release evidence
regardless of permissions.

Even for public issues of public projects.
parent 300844aa
...@@ -15,6 +15,7 @@ module Releases ...@@ -15,6 +15,7 @@ module Releases
# - Project # - Project
# - Milestones # - Milestones
# - Issues # - Issues
# TODO: remove issues from this check: https://gitlab.com/gitlab-org/gitlab/-/issues/259674
condition(:allowed_to_read_evidence) do condition(:allowed_to_read_evidence) do
can?(:read_release) && can?(:read_release) &&
can?(:download_code) && can?(:download_code) &&
......
...@@ -113,18 +113,6 @@ RSpec.describe Projects::Releases::EvidencesController do ...@@ -113,18 +113,6 @@ RSpec.describe Projects::Releases::EvidencesController do
it_behaves_like 'does not show the issue in evidence' it_behaves_like 'does not show the issue in evidence'
context 'when the issue is confidential' do
let(:issue) { create(:issue, :confidential, project: project) }
it_behaves_like 'does not show the issue in evidence'
end
context 'when the user is the author of the confidential issue' do
let(:issue) { create(:issue, :confidential, project: project, author: user) }
it_behaves_like 'does not show the issue in evidence'
end
context 'when project is private' do context 'when project is private' do
let(:project) { create(:project, :repository, :private) } let(:project) { create(:project, :repository, :private) }
...@@ -143,32 +131,16 @@ RSpec.describe Projects::Releases::EvidencesController do ...@@ -143,32 +131,16 @@ RSpec.describe Projects::Releases::EvidencesController do
it_behaves_like 'does not show the issue in evidence' it_behaves_like 'does not show the issue in evidence'
context 'when the issue is confidential' do
let(:issue) { create(:issue, :confidential, project: project) }
it_behaves_like 'does not show the issue in evidence'
end
context 'when the user is the author of the confidential issue' do
let(:issue) { create(:issue, :confidential, project: project, author: user) }
it_behaves_like 'does not show the issue in evidence'
end
context 'when project is private' do context 'when project is private' do
let(:project) { create(:project, :repository, :private) } let(:project) { create(:project, :repository, :private) }
it 'returns evidence ' do it_behaves_like 'does not show the issue in evidence'
subject
expect(json_response).to eq(evidence.summary)
end
end end
context 'when project restricts the visibility of issues to project members only' do context 'when project restricts the visibility of issues to project members only' do
let(:project) { create(:project, :repository, :issues_private) } let(:project) { create(:project, :repository, :issues_private) }
it_behaves_like 'evidence not found' it_behaves_like 'does not show the issue in evidence'
end end
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