Commit 86558d53 authored by Filipa Lacerda's avatar Filipa Lacerda

Adds verification in case the endpoint already has `.json`

parent 4f265c3b
...@@ -8,8 +8,23 @@ ...@@ -8,8 +8,23 @@
* Uses Vue.Resource * Uses Vue.Resource
*/ */
class PipelinesService { class PipelinesService {
constructor(endpoint) {
this.pipelines = Vue.resource(`${endpoint}.json`); /**
* 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);
} }
/** /**
......
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