diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-12-15 13:14:48 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-12-15 13:16:22 +0300 |
commit | cc6f578d5fc45f9c3d4cc7df5af72b15ce47b3a8 (patch) | |
tree | 078add93784365822d8d8e1a0078cad34d9b1a74 /spec/models/ci | |
parent | f463ef5ec58fd26ad5368f57a29d758756dafc3f (diff) |
Use described_class and update description
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7333#note_20059124
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7333#note_20059187
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7333#note_20059322
Diffstat (limited to 'spec/models/ci')
-rw-r--r-- | spec/models/ci/pipeline_spec.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb index 21df5df1b76..d06c30a891c 100644 --- a/spec/models/ci/pipeline_spec.rb +++ b/spec/models/ci/pipeline_spec.rb @@ -381,7 +381,7 @@ describe Ci::Pipeline, models: true do end end - shared_context 'with some empty pipelines' do + shared_context 'with some outdated pipelines' do before do create_pipeline(:canceled, 'ref', 'A') create_pipeline(:success, 'ref', 'A') @@ -395,10 +395,10 @@ describe Ci::Pipeline, models: true do end describe '.latest' do - include_context 'with some empty pipelines' + include_context 'with some outdated pipelines' context 'when no ref is specified' do - let(:pipelines) { Ci::Pipeline.latest.all } + let(:pipelines) { described_class.latest.all } it 'returns the latest pipeline for the same ref and different sha' do expect(pipelines.map(&:sha)).to contain_exactly('A', 'B', 'C') @@ -408,7 +408,7 @@ describe Ci::Pipeline, models: true do end context 'when ref is specified' do - let(:pipelines) { Ci::Pipeline.latest('ref').all } + let(:pipelines) { described_class.latest('ref').all } it 'returns the latest pipeline for ref and different sha' do expect(pipelines.map(&:sha)).to contain_exactly('A', 'B') @@ -419,21 +419,21 @@ describe Ci::Pipeline, models: true do end describe '.latest_status' do - include_context 'with some empty pipelines' + include_context 'with some outdated pipelines' context 'when no ref is specified' do - let(:latest_status) { Ci::Pipeline.latest_status } + let(:latest_status) { described_class.latest_status } it 'returns the latest status for the same ref and different sha' do - expect(latest_status).to eq(Ci::Pipeline.latest.status) + expect(latest_status).to eq(described_class.latest.status) end end context 'when ref is specified' do - let(:latest_status) { Ci::Pipeline.latest_status('ref') } + let(:latest_status) { described_class.latest_status('ref') } it 'returns the latest status for ref and different sha' do - expect(latest_status).to eq(Ci::Pipeline.latest_status('ref')) + expect(latest_status).to eq(described_class.latest_status('ref')) end end end |