diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-02-16 13:52:07 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-02-28 10:47:48 +0100 |
commit | f0f7af50696035946075daf47cf3ff04117af6bf (patch) | |
tree | 7620a39caed4c966945bcf3674bb3e2ea6672461 | |
parent | 7733f285aca97d444382a59eda0ea3e303539c26 (diff) | |
download | gitlab-ce-f0f7af50696035946075daf47cf3ff04117af6bf.tar.gz |
Reinstate new merge request pipelines hash in API
-rw-r--r-- | app/controllers/projects/merge_requests_controller.rb | 5 | ||||
-rw-r--r-- | spec/controllers/projects/merge_requests_controller_spec.rb | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index 53f30a24312..cfe5d39487d 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -245,9 +245,10 @@ class Projects::MergeRequestsController < Projects::ApplicationController format.json do define_pipelines_vars - render json: PipelineSerializer + render json: { + pipelines: PipelineSerializer .new(project: @project, user: @current_user) - .represent(@pipelines) + .represent(@pipelines) } end end end diff --git a/spec/controllers/projects/merge_requests_controller_spec.rb b/spec/controllers/projects/merge_requests_controller_spec.rb index 1ced666bb36..506dfe0ad8c 100644 --- a/spec/controllers/projects/merge_requests_controller_spec.rb +++ b/spec/controllers/projects/merge_requests_controller_spec.rb @@ -43,7 +43,8 @@ describe Projects::MergeRequestsController do submit_new_merge_request(format: :json) expect(response).to be_ok - expect(json_response).not_to be_empty + expect(json_response).to have_key 'pipelines' + expect(json_response['pipelines']).not_to be_empty end end end |