Fix broken link for latest deployment

Updates changelog with MR ID
This commit is contained in:
Filipa Lacerda 2016-11-30 11:57:38 +00:00
parent 5186618bb0
commit 186c4dd7b4
4 changed files with 33 additions and 2 deletions

View file

@ -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

View file

@ -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?

View file

@ -0,0 +1,4 @@
---
title: Fix Latest deployment link is broken
merge_request: 7839
author:

View file

@ -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