Commit 1571d468 authored by Filipa Lacerda's avatar Filipa Lacerda

Fix broken url for stop action

parent 9c3f9d84
...@@ -13,6 +13,12 @@ ...@@ -13,6 +13,12 @@
}, },
}, },
computed: {
stopUrl() {
return `${this.stop_url}/stop`;
},
},
methods: { methods: {
openConfirmDialog() { openConfirmDialog() {
return window.confirm('Are you sure you want to stop this environment?'); // eslint-disable-line return window.confirm('Are you sure you want to stop this environment?'); // eslint-disable-line
...@@ -22,9 +28,9 @@ ...@@ -22,9 +28,9 @@
template: ` template: `
<a v-on:click="openConfirmDialog" <a v-on:click="openConfirmDialog"
class="btn stop-env-link" class="btn stop-env-link"
:href="stop_url" :href="stopUrl"
method="post" data-method="post"
rel="nofollow"> data-rel="nofollow">
<i class="fa fa-stop stop-env-icon"></i> <i class="fa fa-stop stop-env-icon"></i>
</a> </a>
`, `,
......
...@@ -59,6 +59,7 @@ feature 'Environments', feature: true, js: true do ...@@ -59,6 +59,7 @@ feature 'Environments', feature: true, js: true do
given(:deployment) { create(:deployment, environment: environment) } given(:deployment) { create(:deployment, environment: environment) }
scenario 'does show deployment SHA' do scenario 'does show deployment SHA' do
# TODO: Fix me!
expect(page).to have_link(deployment.short_sha) expect(page).to have_link(deployment.short_sha)
end end
...@@ -73,11 +74,15 @@ feature 'Environments', feature: true, js: true do ...@@ -73,11 +74,15 @@ feature 'Environments', feature: true, js: true do
given(:manual) { create(:ci_build, :manual, pipeline: pipeline, name: 'deploy to production') } given(:manual) { create(:ci_build, :manual, pipeline: pipeline, name: 'deploy to production') }
scenario 'does show a play button' do scenario 'does show a play button' do
# TODO: Fix me!
binding.pry
expect(page).to have_link(manual.name.humanize) expect(page).to have_link(manual.name.humanize)
end end
scenario 'does allow to play manual action' do scenario 'does allow to play manual action' do
expect(manual).to be_skipped expect(manual).to be_skipped
# TODO: Fix me!
binding.pry
expect{ click_link(manual.name.humanize) }.not_to change { Ci::Pipeline.count } expect{ click_link(manual.name.humanize) }.not_to change { Ci::Pipeline.count }
expect(page).to have_content(manual.name) expect(page).to have_content(manual.name)
expect(manual.reload).to be_pending expect(manual.reload).to be_pending
...@@ -114,7 +119,7 @@ feature 'Environments', feature: true, js: true do ...@@ -114,7 +119,7 @@ feature 'Environments', feature: true, js: true do
end end
scenario 'starts build when stop button clicked' do 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') expect(page).to have_content('close_app')
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