Commit 9ed7171a authored by Annabel Dunstone Gray's avatar Annabel Dunstone Gray

Fix builds/show spec; use iid instead of id

parent 43906336
......@@ -17,7 +17,7 @@ module EnvironmentHelper
def deployment_link(deployment)
return unless deployment
link_to "##{deployment.id}", [deployment.project.namespace.becomes(Namespace), deployment.project, deployment.deployable]
link_to "##{deployment.iid}", [deployment.project.namespace.becomes(Namespace), deployment.project, deployment.deployable]
end
def last_deployment_link_for_environment_build(project, build)
......
......@@ -43,7 +43,7 @@
- if environment.last_deployment
View the most recent deployment #{deployment_link(environment.last_deployment)}.
- elsif @build.complete? && !@build.success?
The deployment of this build to #{environment_link_for_build(@build.project, @build)} did not complete.
The deployment of this build to #{environment_link_for_build(@build.project, @build)} did not succeed.
- else
This build is creating a deployment to #{environment_link_for_build(@build.project, @build)}
- if environment.last_deployment
......
......@@ -40,6 +40,10 @@ describe 'projects/builds/show', :view do
create(:ci_build, :success, environment: 'staging', pipeline: pipeline)
end
let(:second_build) do
create(:ci_build, :success, environment: 'staging', pipeline: pipeline)
end
let(:environment) do
create(:environment, name: 'staging', project: project)
end
......@@ -49,12 +53,12 @@ describe 'projects/builds/show', :view do
end
let!(:second_deployment) do
create(:deployment, environment: environment, deployable: build)
create(:deployment, environment: environment, deployable: second_build)
end
it 'shows deployment message' do
expected_text = 'This build is an out-of-date deployment ' \
"to staging.\nView the most recent deployment ##{second_deployment.id}."
"to staging.\nView the most recent deployment ##{second_deployment.iid}."
render
expect(rendered).to have_css('.environment-information', text: expected_text)
......@@ -71,7 +75,7 @@ describe 'projects/builds/show', :view do
end
it 'shows deployment message' do
expected_text = 'The deployment of this build to staging did not complete.'
expected_text = 'The deployment of this build to staging did not succeed.'
render
expect(rendered).to have_css(
......@@ -107,7 +111,7 @@ describe 'projects/builds/show', :view do
end
it 'shows deployment message' do
expected_text = 'The deployment of this build to staging did not complete'
expected_text = 'The deployment of this build to staging did not succeed'
render
expect(rendered).to have_css(
......
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