diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2018-10-03 18:29:07 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-10-03 18:29:07 +0300 |
commit | 9128e7849dbc064913b52ad427dcfb15386ad23e (patch) | |
tree | 664e0fca75719f1841d06d3e3eb493f6f9347f34 /spec/views | |
parent | 88c1cf676cf02c3fca16093ad8ee5f6cf02dc462 (diff) |
Uses Vue app to render part of job show page
Diffstat (limited to 'spec/views')
-rw-r--r-- | spec/views/projects/jobs/show.html.haml_spec.rb | 155 |
1 files changed, 0 insertions, 155 deletions
diff --git a/spec/views/projects/jobs/show.html.haml_spec.rb b/spec/views/projects/jobs/show.html.haml_spec.rb index 496646dc623..e06a9ecb98b 100644 --- a/spec/views/projects/jobs/show.html.haml_spec.rb +++ b/spec/views/projects/jobs/show.html.haml_spec.rb @@ -18,161 +18,6 @@ describe 'projects/jobs/show' do allow(view).to receive(:can?).and_return(true) end - describe 'environment info in job view' do - context 'job with latest deployment' do - let(:build) do - create(:ci_build, :success, :trace_artifact, environment: 'staging') - end - - before do - create(:environment, name: 'staging') - create(:deployment, deployable: build) - end - - it 'shows deployment message' do - expected_text = 'This job is the most recent deployment' - render - - expect(rendered).to have_css( - '.environment-information', text: expected_text) - end - end - - context 'job with outdated deployment' do - let(:build) do - create(:ci_build, :success, :trace_artifact, environment: 'staging', pipeline: pipeline) - end - - let(:second_build) do - create(:ci_build, :success, :trace_artifact, environment: 'staging', pipeline: pipeline) - end - - let(:environment) do - create(:environment, name: 'staging', project: project) - end - - let!(:first_deployment) do - create(:deployment, environment: environment, deployable: build) - end - - let!(:second_deployment) do - create(:deployment, environment: environment, deployable: second_build) - end - - it 'shows deployment message' do - expected_text = 'This job is an out-of-date deployment ' \ - "to staging.\nView the most recent deployment ##{second_deployment.iid}." - render - - expect(rendered).to have_css('.environment-information', text: expected_text) - end - end - - context 'job failed to deploy' do - let(:build) do - create(:ci_build, :failed, :trace_artifact, environment: 'staging', pipeline: pipeline) - end - - let!(:environment) do - create(:environment, name: 'staging', project: project) - end - - it 'shows deployment message' do - expected_text = 'The deployment of this job to staging did not succeed.' - render - - expect(rendered).to have_css( - '.environment-information', text: expected_text) - end - end - - context 'job will deploy' do - let(:build) do - create(:ci_build, :running, :trace_live, environment: 'staging', pipeline: pipeline) - end - - context 'when environment exists' do - let!(:environment) do - create(:environment, name: 'staging', project: project) - end - - it 'shows deployment message' do - expected_text = 'This job is creating a deployment to staging' - render - - expect(rendered).to have_css( - '.environment-information', text: expected_text) - end - - context 'when it has deployment' do - let!(:deployment) do - create(:deployment, environment: environment) - end - - it 'shows that deployment will be overwritten' do - expected_text = 'This job is creating a deployment to staging' - render - - expect(rendered).to have_css( - '.environment-information', text: expected_text) - expect(rendered).to have_css( - '.environment-information', text: 'latest deployment') - end - end - end - - context 'when environment does not exist' do - it 'shows deployment message' do - expected_text = 'This job is creating a deployment to staging' - render - - expect(rendered).to have_css( - '.environment-information', text: expected_text) - expect(rendered).not_to have_css( - '.environment-information', text: 'latest deployment') - end - end - end - - context 'job that failed to deploy and environment has not been created' do - let(:build) do - create(:ci_build, :failed, :trace_artifact, environment: 'staging', pipeline: pipeline) - end - - let!(:environment) do - create(:environment, name: 'staging', project: project) - end - - it 'shows deployment message' do - expected_text = 'The deployment of this job to staging did not succeed' - render - - expect(rendered).to have_css( - '.environment-information', text: expected_text) - end - end - - context 'job that will deploy and environment has not been created' do - let(:build) do - create(:ci_build, :running, :trace_live, environment: 'staging', pipeline: pipeline) - end - - let!(:environment) do - create(:environment, name: 'staging', project: project) - end - - it 'shows deployment message' do - expected_text = 'This job is creating a deployment to staging' - render - - expect(rendered).to have_css( - '.environment-information', text: expected_text) - expect(rendered).not_to have_css( - '.environment-information', text: 'latest deployment') - end - end - end - context 'when job is running' do let(:build) { create(:ci_build, :trace_live, :running, pipeline: pipeline) } |