From ab3cfd520dc02a62dea2a8d73a4060fc1cbc865a Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 9 Aug 2016 21:24:12 +0200 Subject: Fix all tests --- spec/features/pipelines_spec.rb | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'spec/features') diff --git a/spec/features/pipelines_spec.rb b/spec/features/pipelines_spec.rb index 1256f73196b..f88b8f8e60b 100644 --- a/spec/features/pipelines_spec.rb +++ b/spec/features/pipelines_spec.rb @@ -33,7 +33,10 @@ describe "Pipelines" do context 'cancelable pipeline' do let!(:running) { create(:ci_build, :running, pipeline: pipeline, stage: 'test', commands: 'test') } - before { visit namespace_project_pipelines_path(project.namespace, project) } + before do + pipeline.reload_status! + visit namespace_project_pipelines_path(project.namespace, project) + end it { expect(page).to have_link('Cancel') } it { expect(page).to have_selector('.ci-running') } @@ -49,7 +52,10 @@ describe "Pipelines" do context 'retryable pipelines' do let!(:failed) { create(:ci_build, :failed, pipeline: pipeline, stage: 'test', commands: 'test') } - before { visit namespace_project_pipelines_path(project.namespace, project) } + before do + pipeline.reload_status! + visit namespace_project_pipelines_path(project.namespace, project) + end it { expect(page).to have_link('Retry') } it { expect(page).to have_selector('.ci-failed') } @@ -80,7 +86,10 @@ describe "Pipelines" do context 'when running' do let!(:running) { create(:generic_commit_status, status: 'running', pipeline: pipeline, stage: 'test') } - before { visit namespace_project_pipelines_path(project.namespace, project) } + before do + pipeline.reload_status! + visit namespace_project_pipelines_path(project.namespace, project) + end it 'is not cancelable' do expect(page).not_to have_link('Cancel') @@ -92,9 +101,12 @@ describe "Pipelines" do end context 'when failed' do - let!(:running) { create(:generic_commit_status, status: 'failed', pipeline: pipeline, stage: 'test') } + let!(:failed) { create(:generic_commit_status, status: 'failed', pipeline: pipeline, stage: 'test') } - before { visit namespace_project_pipelines_path(project.namespace, project) } + before do + pipeline.reload_status! + visit namespace_project_pipelines_path(project.namespace, project) + end it 'is not retryable' do expect(page).not_to have_link('Retry') -- cgit v1.2.1