Commit 186c4dd7 authored by Filipa Lacerda's avatar Filipa Lacerda

Fix broken link for latest deployment

Updates changelog with MR ID
parent 5186618b
......@@ -20,6 +20,12 @@ module EnvironmentHelper
link_to "##{deployment.iid}", [deployment.project.namespace.becomes(Namespace), deployment.project, deployment.deployable]
end
def last_deployment_link(deployment, link_text)
return unless deployment
link_to link_text, [deployment.project.namespace.becomes(Namespace), deployment.project, deployment.deployable]
end
def last_deployment_link_for_environment_build(project, build)
environment = environment_for_build(project, build)
return unless environment
......
......@@ -46,8 +46,7 @@
- else
This build is creating a deployment to #{environment_link_for_build(@build.project, @build)}
- if environment.try(:last_deployment)
and will overwrite the
= link_to 'latest deployment', deployment_link(environment.last_deployment)
and will overwrite the #{last_deployment_link(environment.last_deployment, 'latest deployment')}
.prepend-top-default
- if @build.erased?
......
---
title: Fix Latest deployment link is broken
merge_request: 7839
author:
......@@ -227,6 +227,28 @@ feature 'Builds', :feature do
expect(page).to have_selector('.js-build-value', text: 'TRIGGER_VALUE_1')
end
end
context "Build starts environment" do
context "Build is successfull and has deployment" do
it "shows a link for the build" do
-# link to environment.name
expect(page).to have_link()
end
end
context "Build is complete and not successfull" do
it "shows a link for the build" do
-# link to environment.name
expect(page).to have_link()
end
end
context "Build creates a new deployment" do
it "shows a link to lastest deployment" do
expect(page).to have_link("latest deployment")
end
end
end
end
describe "POST /:project/builds/:id/cancel" do
......
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