Commit 2fe6d030 authored by Gary Holtz's avatar Gary Holtz

Adding a conditional to resolve_with_issue_path

parent 8d95b015
...@@ -40,7 +40,7 @@ class BaseDiscussionEntity < Grape::Entity ...@@ -40,7 +40,7 @@ class BaseDiscussionEntity < Grape::Entity
end end
expose :resolve_with_issue_path do |discussion| expose :resolve_with_issue_path do |discussion|
new_project_issue_path(discussion.project, merge_request_to_resolve_discussions_of: discussion.noteable.iid, discussion_to_resolve: discussion.id) new_project_issue_path(discussion.project, merge_request_to_resolve_discussions_of: discussion.noteable.iid, discussion_to_resolve: discussion.id) if discussion.project.issues_enabled?
end end
end end
......
---
title: Do not show button to resolve discussion opening an issue when issues are disabled
merge_request: 54263
author:
type: fixed
...@@ -66,4 +66,13 @@ RSpec.describe BaseDiscussionEntity do ...@@ -66,4 +66,13 @@ RSpec.describe BaseDiscussionEntity do
) )
end end
end end
context 'when issues are disabled in a project' do
let(:project) { create(:project, :issues_disabled) }
let(:note) { create(:discussion_note_on_merge_request, project: project) }
it 'does not show a new issues path' do
expect(entity.as_json[:resolve_with_issue_path]).to be_nil
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