summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2016-11-16 17:05:35 +0000
committerFilipa Lacerda <filipa@gitlab.com>2016-11-16 17:05:35 +0000
commit1571d4686d0fbb41d603ee0deafe208f5d23e5c1 (patch)
tree9598c24cbcc66a7839f4b80e1a0179c538d585b2
parent9c3f9d84646013b8a9bf605b29d18189693e1c79 (diff)
downloadgitlab-ce-1571d4686d0fbb41d603ee0deafe208f5d23e5c1.tar.gz
Fix broken url for stop action
-rw-r--r--app/assets/javascripts/environments/components/environment_stop.js.es612
-rw-r--r--spec/features/environments_spec.rb7
2 files changed, 15 insertions, 4 deletions
diff --git a/app/assets/javascripts/environments/components/environment_stop.js.es6 b/app/assets/javascripts/environments/components/environment_stop.js.es6
index b39af2efb57..779d16937ec 100644
--- a/app/assets/javascripts/environments/components/environment_stop.js.es6
+++ b/app/assets/javascripts/environments/components/environment_stop.js.es6
@@ -13,6 +13,12 @@
},
},
+ computed: {
+ stopUrl() {
+ return `${this.stop_url}/stop`;
+ },
+ },
+
methods: {
openConfirmDialog() {
return window.confirm('Are you sure you want to stop this environment?'); // eslint-disable-line
@@ -22,9 +28,9 @@
template: `
<a v-on:click="openConfirmDialog"
class="btn stop-env-link"
- :href="stop_url"
- method="post"
- rel="nofollow">
+ :href="stopUrl"
+ data-method="post"
+ data-rel="nofollow">
<i class="fa fa-stop stop-env-icon"></i>
</a>
`,
diff --git a/spec/features/environments_spec.rb b/spec/features/environments_spec.rb
index b932d672548..fe5a783a386 100644
--- a/spec/features/environments_spec.rb
+++ b/spec/features/environments_spec.rb
@@ -59,6 +59,7 @@ feature 'Environments', feature: true, js: true do
given(:deployment) { create(:deployment, environment: environment) }
scenario 'does show deployment SHA' do
+ # TODO: Fix me!
expect(page).to have_link(deployment.short_sha)
end
@@ -73,11 +74,15 @@ feature 'Environments', feature: true, js: true do
given(:manual) { create(:ci_build, :manual, pipeline: pipeline, name: 'deploy to production') }
scenario 'does show a play button' do
+ # TODO: Fix me!
+ binding.pry
expect(page).to have_link(manual.name.humanize)
end
scenario 'does allow to play manual action' do
expect(manual).to be_skipped
+ # TODO: Fix me!
+ binding.pry
expect{ click_link(manual.name.humanize) }.not_to change { Ci::Pipeline.count }
expect(page).to have_content(manual.name)
expect(manual.reload).to be_pending
@@ -114,7 +119,7 @@ feature 'Environments', feature: true, js: true do
end
scenario 'starts build when stop button clicked' do
- page.find('.stop-env-link').click
+ find('.stop-env-link').click
expect(page).to have_content('close_app')
end