Commit 1cd4ef5c authored by Sean Carroll's avatar Sean Carroll

Correct link to Merge trains docs on MR widget

Closes https://gitlab.com/gitlab-org/gitlab/issues/34406

See merge request https://gitlab.com/gitlab-org/gitlab/merge_requests/19726
parent 64d6c3ab
...@@ -101,3 +101,5 @@ class MergeRequestPollCachedWidgetEntity < IssuableEntity ...@@ -101,3 +101,5 @@ class MergeRequestPollCachedWidgetEntity < IssuableEntity
merged_by: merge_event&.author) merged_by: merge_event&.author)
end end
end end
MergeRequestPollCachedWidgetEntity.prepend_if_ee('EE::MergeRequestPollCachedWidgetEntity')
---
title: Correct link to Merge trains documentation on MR widget
merge_request: 19726
author:
type: changed
# frozen_string_literal: true
module EE
module MergeRequestPollCachedWidgetEntity
extend ActiveSupport::Concern
prepended do
expose :merge_train_when_pipeline_succeeds_docs_path do |merge_request|
presenter(merge_request).merge_train_when_pipeline_succeeds_docs_path
end
end
end
end
# frozen_string_literal: true
require 'spec_helper'
describe Projects::MergeRequests::ContentController do
let(:project) { create(:project, :repository) }
let(:user) { create(:user) }
let(:merge_request) { create(:merge_request, target_project: project, source_project: project) }
before do
sign_in(user)
end
def do_request(action = :cached_widget)
get action, params: {
namespace_id: project.namespace.to_param,
project_id: project,
id: merge_request.iid,
format: :json
}
end
context 'user has access to the project' do
before do
expect(::Gitlab::GitalyClient).to receive(:allow_ref_name_caching).and_call_original
project.add_maintainer(user)
end
describe 'GET cached_widget' do
it 'renders widget MR entity as json' do
do_request
expect(response).to match_response_schema('entities/merge_request_poll_cached_widget')
end
end
end
end
{
"type": "object",
"allOf": [
{ "$ref": "../../../../../../spec/fixtures/api/schemas/entities/merge_request_poll_cached_widget.json" },
{
"properties" : {
"merge_train_when_pipeline_succeeds_docs_path": { "type": "string" }
}
}
]
}
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