diff --git a/spec/controllers/projects/issues_controller_spec.rb b/spec/controllers/projects/issues_controller_spec.rb index 602502c09f54d265cbbb8a78c94e08766ddf0e58..968e097991aeb50b195aade7ffef060c7b451636 100644 --- a/spec/controllers/projects/issues_controller_spec.rb +++ b/spec/controllers/projects/issues_controller_spec.rb @@ -877,46 +877,4 @@ describe Projects::IssuesController do format: :json end end - - describe 'GET #discussions' do - let!(:discussion) { create(:discussion_note_on_issue, noteable: issue, project: issue.project) } - context 'when authenticated' do - before do - project.add_developer(user) - sign_in(user) - end - - it 'returns discussion json' do - get :discussions, namespace_id: project.namespace, project_id: project, id: issue.iid - - expect(json_response.first.keys).to match_array(%w[id reply_id expanded notes individual_note]) - end - end - - context 'with cross-reference system note', :request_store do - let(:new_issue) { create(:issue) } - let(:cross_reference) { "mentioned in #{new_issue.to_reference(issue.project)}" } - - before do - create(:discussion_note_on_issue, :system, noteable: issue, project: issue.project, note: cross_reference) - end - - it 'does not result in N+1 queries' do - # Instantiate the controller variables to ensure QueryRecorder has an accurate base count - get :discussions, namespace_id: project.namespace, project_id: project, id: issue.iid - - RequestStore.clear! - - control_count = ActiveRecord::QueryRecorder.new do - get :discussions, namespace_id: project.namespace, project_id: project, id: issue.iid - end.count - - RequestStore.clear! - - create_list(:discussion_note_on_issue, 2, :system, noteable: issue, project: issue.project, note: cross_reference) - - expect { get :discussions, namespace_id: project.namespace, project_id: project, id: issue.iid }.not_to exceed_query_limit(control_count) - end - end - end end