summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2016-11-19 12:37:54 +0000
committerFilipa Lacerda <filipa@gitlab.com>2016-11-19 12:37:54 +0000
commitf9a662c38fc8bbcee66ab08db53f86bdad146784 (patch)
treebde77ad7c14498b8347651f9f83b6da26ecacc50
parentd2007ee6ddaf665170bac0ed63fc1a3ab92b04db (diff)
downloadgitlab-ce-f9a662c38fc8bbcee66ab08db53f86bdad146784.tar.gz
Changes for stop url to path
-rw-r--r--app/assets/javascripts/environments/components/environment_stop.js.es68
-rw-r--r--spec/javascripts/environments/environment_stop_spec.js.es616
2 files changed, 1 insertions, 23 deletions
diff --git a/app/assets/javascripts/environments/components/environment_stop.js.es6 b/app/assets/javascripts/environments/components/environment_stop.js.es6
index 171d2d7fae3..bfcca40f8c0 100644
--- a/app/assets/javascripts/environments/components/environment_stop.js.es6
+++ b/app/assets/javascripts/environments/components/environment_stop.js.es6
@@ -13,12 +13,6 @@
},
},
- computed: {
- stopUrl() {
- return this.stop_url;
- },
- },
-
methods: {
openConfirmDialog() {
return window.confirm('Are you sure you want to stop this environment?'); // eslint-disable-line
@@ -28,7 +22,7 @@
template: `
<a v-on:click="openConfirmDialog"
class="btn stop-env-link"
- :href="stopUrl"
+ :href="stop_url"
data-method="post"
rel="nofollow">
<i class="fa fa-stop stop-env-icon"></i>
diff --git a/spec/javascripts/environments/environment_stop_spec.js.es6 b/spec/javascripts/environments/environment_stop_spec.js.es6
index d3eff278292..37fba925e16 100644
--- a/spec/javascripts/environments/environment_stop_spec.js.es6
+++ b/spec/javascripts/environments/environment_stop_spec.js.es6
@@ -16,20 +16,4 @@ describe('Stop Component', () => {
});
expect(component.$el.getAttribute('href')).toEqual(stopURL);
});
-
- describe('When clicked', () => {
- it('Should open popup with confirmation warning', () => {
- const component = new window.gl.environmentsList.StopComponent({
- el: document.querySelector('.test-dom-element'),
- propsData: {
- stop_url: '#',
- },
- });
-
- var confirm = spyOn(window, 'confirm');
- confirm.and.returnValue(false);
- component.$el.click();
- expect(confirm).toHaveBeenCalled();
- });
- });
});