Merge branch '27932-merge-request-pipelines-displays-json' into 'master'

Adds `.json` to the endpoint requested in order to avoid showing JSON

Closes #27932

See merge request !9105
This commit is contained in:
Alfredo Sumaran 2017-02-14 16:04:20 +00:00
commit e45d8cd97a
3 changed files with 23 additions and 1 deletions

View File

@ -8,7 +8,22 @@
* Uses Vue.Resource
*/
class PipelinesService {
constructor(endpoint) {
/**
* FIXME: The url provided to request the pipelines in the new merge request
* page already has `.json`.
* This should be fixed when the endpoint is improved.
*
* @param {String} root
*/
constructor(root) {
let endpoint;
if (root.indexOf('.json') === -1) {
endpoint = `${root}.json`;
} else {
endpoint = root;
}
this.pipelines = Vue.resource(endpoint);
}

View File

@ -0,0 +1,4 @@
---
title: Fix Merge request pipelines displays JSON
merge_request:
author:

View File

@ -1,6 +1,8 @@
require 'spec_helper'
feature 'Create New Merge Request', feature: true, js: true do
include WaitForVueResource
let(:user) { create(:user) }
let(:project) { create(:project, :public) }
@ -99,6 +101,7 @@ feature 'Create New Merge Request', feature: true, js: true do
page.within('.merge-request') do
click_link 'Pipelines'
wait_for_vue_resource
expect(page).to have_content "##{pipeline.id}"
end