Commit 8443cee0 authored by Filipa Lacerda's avatar Filipa Lacerda

Fixes external_url link

Adds tests for:
  - external_url link in environmnets list
  - must show deployment internal id in environments list
  - must show build name and id in environments list
parent f7303dd6
- if can?(current_user, :create_deployment, deployment) && deployment.deployable - if can?(current_user, :create_deployment, deployment) && deployment.deployable
.pull-right .pull-right
- external_url = deployment.deployable.try(:external_url) - external_url = deployment.environment.try(:external_url)
- if external_url - if external_url
= link_to external_url, target: '_blank', class: 'btn external-url' do = link_to external_url, target: '_blank', class: 'btn external-url' do
= icon('external-link') = icon('external-link')
......
...@@ -44,6 +44,10 @@ feature 'Environments', feature: true do ...@@ -44,6 +44,10 @@ feature 'Environments', feature: true do
scenario 'does show deployment SHA' do scenario 'does show deployment SHA' do
expect(page).to have_link(deployment.short_sha) expect(page).to have_link(deployment.short_sha)
end end
scenario 'does show deployment internal id' do
expect(page).to have_content(deployment.iid)
end
context 'with build and manual actions' do context 'with build and manual actions' do
given(:pipeline) { create(:ci_pipeline, project: project) } given(:pipeline) { create(:ci_pipeline, project: project) }
...@@ -61,6 +65,20 @@ feature 'Environments', feature: true do ...@@ -61,6 +65,20 @@ feature 'Environments', feature: true do
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
end end
scenario 'does show build name and id' do
expect(page).to have_link("#{build.name} (##{build.id})")
end
context 'with external_url' do
given(:environment) { create(:environment, project: project, external_url: 'https://git.gitlab.com') }
given(:build) { create(:ci_build, pipeline: pipeline) }
given(:deployment) { create(:deployment, environment: environment, deployable: build) }
scenario 'does show an external link button' do
expect(page).to have_selector('.btn.external-url')
end
end
end end
end end
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