Commit 96cbdcaf authored by charlie ablett's avatar charlie ablett

Merge branch 'issue_221090' into 'master'

Fix creating confidential issues of public epics

See merge request gitlab-org/gitlab!34309
parents 91604006 3ca6abc5
......@@ -18,7 +18,7 @@ module EE
epic = params.delete(:epic)
if epic
issue.confidential = epic.confidential?
issue.confidential = true if epic.confidential?
EpicIssues::CreateService.new(epic, current_user, { target_issuable: issue }).execute
else
......
......@@ -84,10 +84,9 @@ RSpec.describe Issues::CreateService do
end
end
context 'when adding an issue to confidential epic' do
let(:confidential_epic) { create(:epic, group: group, confidential: true) }
it 'creates a confidential issue' do
context 'when adding a public issue to confidential epic' do
it 'creates confidential child issue' do
confidential_epic = create(:epic, group: group, confidential: true)
params = { title: 'confidential issue', epic_id: confidential_epic.id }
issue = described_class.new(project, user, params).execute
......@@ -95,6 +94,16 @@ RSpec.describe Issues::CreateService do
expect(issue.confidential).to eq(true)
end
end
context 'when adding a confidential issue to public epic' do
it 'creates a confidential child issue' do
params = { title: 'confidential issue', epic_id: epic.id, confidential: true }
issue = described_class.new(project, user, params).execute
expect(issue.confidential).to eq(true)
end
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