Commit 69e0c3c5 authored by Alfredo Sumaran's avatar Alfredo Sumaran Committed by Felipe Artur

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
parent 772b37af
...@@ -8,7 +8,22 @@ ...@@ -8,7 +8,22 @@
* Uses Vue.Resource * Uses Vue.Resource
*/ */
class PipelinesService { 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); this.pipelines = Vue.resource(endpoint);
} }
......
---
title: Fix Merge request pipelines displays JSON
merge_request:
author:
require 'spec_helper' require 'spec_helper'
feature 'Create New Merge Request', feature: true, js: true do feature 'Create New Merge Request', feature: true, js: true do
include WaitForVueResource
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
...@@ -99,6 +101,7 @@ feature 'Create New Merge Request', feature: true, js: true do ...@@ -99,6 +101,7 @@ feature 'Create New Merge Request', feature: true, js: true do
page.within('.merge-request') do page.within('.merge-request') do
click_link 'Pipelines' click_link 'Pipelines'
wait_for_vue_resource
expect(page).to have_content "##{pipeline.id}" expect(page).to have_content "##{pipeline.id}"
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