Commit 48ea1428 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Fix pipeline specs for detailed statuses

[ci skip]
parent ab37be2d
...@@ -442,11 +442,15 @@ describe Ci::Pipeline, models: true do ...@@ -442,11 +442,15 @@ describe Ci::Pipeline, models: true do
end end
describe '#detailed_status' do describe '#detailed_status' do
let(:user) { create(:user) }
subject { pipeline.detailed_status(user) }
context 'when pipeline is created' do context 'when pipeline is created' do
let(:pipeline) { create(:ci_pipeline, status: :created) } let(:pipeline) { create(:ci_pipeline, status: :created) }
it 'returns detailed status for created pipeline' do it 'returns detailed status for created pipeline' do
expect(pipeline.detailed_status.text).to eq 'created' expect(subject.text).to eq 'created'
end end
end end
...@@ -454,7 +458,7 @@ describe Ci::Pipeline, models: true do ...@@ -454,7 +458,7 @@ describe Ci::Pipeline, models: true do
let(:pipeline) { create(:ci_pipeline, status: :pending) } let(:pipeline) { create(:ci_pipeline, status: :pending) }
it 'returns detailed status for pending pipeline' do it 'returns detailed status for pending pipeline' do
expect(pipeline.detailed_status.text).to eq 'pending' expect(subject.text).to eq 'pending'
end end
end end
...@@ -462,7 +466,7 @@ describe Ci::Pipeline, models: true do ...@@ -462,7 +466,7 @@ describe Ci::Pipeline, models: true do
let(:pipeline) { create(:ci_pipeline, status: :running) } let(:pipeline) { create(:ci_pipeline, status: :running) }
it 'returns detailed status for running pipeline' do it 'returns detailed status for running pipeline' do
expect(pipeline.detailed_status.text).to eq 'running' expect(subject.text).to eq 'running'
end end
end end
...@@ -470,7 +474,7 @@ describe Ci::Pipeline, models: true do ...@@ -470,7 +474,7 @@ describe Ci::Pipeline, models: true do
let(:pipeline) { create(:ci_pipeline, status: :success) } let(:pipeline) { create(:ci_pipeline, status: :success) }
it 'returns detailed status for successful pipeline' do it 'returns detailed status for successful pipeline' do
expect(pipeline.detailed_status.text).to eq 'passed' expect(subject.text).to eq 'passed'
end end
end end
...@@ -478,7 +482,7 @@ describe Ci::Pipeline, models: true do ...@@ -478,7 +482,7 @@ describe Ci::Pipeline, models: true do
let(:pipeline) { create(:ci_pipeline, status: :failed) } let(:pipeline) { create(:ci_pipeline, status: :failed) }
it 'returns detailed status for failed pipeline' do it 'returns detailed status for failed pipeline' do
expect(pipeline.detailed_status.text).to eq 'failed' expect(subject.text).to eq 'failed'
end end
end end
...@@ -486,7 +490,7 @@ describe Ci::Pipeline, models: true do ...@@ -486,7 +490,7 @@ describe Ci::Pipeline, models: true do
let(:pipeline) { create(:ci_pipeline, status: :canceled) } let(:pipeline) { create(:ci_pipeline, status: :canceled) }
it 'returns detailed status for canceled pipeline' do it 'returns detailed status for canceled pipeline' do
expect(pipeline.detailed_status.text).to eq 'canceled' expect(subject.text).to eq 'canceled'
end end
end end
...@@ -494,7 +498,7 @@ describe Ci::Pipeline, models: true do ...@@ -494,7 +498,7 @@ describe Ci::Pipeline, models: true do
let(:pipeline) { create(:ci_pipeline, status: :skipped) } let(:pipeline) { create(:ci_pipeline, status: :skipped) }
it 'returns detailed status for skipped pipeline' do it 'returns detailed status for skipped pipeline' do
expect(pipeline.detailed_status.text).to eq 'skipped' expect(subject.text).to eq 'skipped'
end end
end end
...@@ -506,7 +510,7 @@ describe Ci::Pipeline, models: true do ...@@ -506,7 +510,7 @@ describe Ci::Pipeline, models: true do
end end
it 'retruns detailed status for successful pipeline with warnings' do it 'retruns detailed status for successful pipeline with warnings' do
expect(pipeline.detailed_status.label).to eq 'passed with warnings' expect(subject.label).to eq 'passed with warnings'
end end
end end
end end
......
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