summaryrefslogtreecommitdiff
path: root/spec/finders
diff options
context:
space:
mode:
authorShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-03-07 22:19:15 +0900
committerShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-05-03 02:11:51 +0900
commit40e8940195a05bf2e3802550a571f889853c0200 (patch)
tree257aa0d2b9c2f224d510f4d3807d6a20cc9d59e2 /spec/finders
parentd33e762167a197f30d075ed409ca1a07ae9f83c6 (diff)
downloadgitlab-ce-40e8940195a05bf2e3802550a571f889853c0200.tar.gz
include to all(eq()). Test status, not scope.
Diffstat (limited to 'spec/finders')
-rw-r--r--spec/finders/pipelines_finder_spec.rb32
1 files changed, 16 insertions, 16 deletions
diff --git a/spec/finders/pipelines_finder_spec.rb b/spec/finders/pipelines_finder_spec.rb
index a16d3bb8d25..444ce7e1267 100644
--- a/spec/finders/pipelines_finder_spec.rb
+++ b/spec/finders/pipelines_finder_spec.rb
@@ -40,7 +40,7 @@ describe PipelinesFinder do
let(:params) { { scope: 'running' } }
it 'has only running status' do
- expect(subject.map(&:status)).to include('running')
+ expect(subject.map(&:status)).to all(eq('running'))
end
end
@@ -48,7 +48,7 @@ describe PipelinesFinder do
let(:params) { { scope: 'pending' } }
it 'has only pending status' do
- expect(subject.map(&:status)).to include('pending')
+ expect(subject.map(&:status)).to all(eq('pending'))
end
end
@@ -66,7 +66,7 @@ describe PipelinesFinder do
it 'excludes tags' do
expect(subject.count).to be 1
expect(subject).not_to include dummy_pipelines[:tag]
- expect(subject.map(&:ref)).to include('master')
+ expect(subject.map(&:ref)).to all(eq('master'))
end
end
@@ -76,57 +76,57 @@ describe PipelinesFinder do
it 'excludes branches' do
expect(subject.count).to be 1
expect(subject).to include dummy_pipelines[:tag]
- expect(subject.map(&:ref)).not_to include('master')
+ expect(subject.map(&:ref)).not_to all(eq('master'))
end
end
end
context 'when a status is passed' do
context 'when selecting running' do
- let(:params) { { scope: 'running' } }
+ let(:params) { { status: 'running' } }
it 'has only running status' do
- expect(subject.map(&:status)).to include('running')
+ expect(subject.map(&:status)).to all(eq('running'))
end
end
context 'when selecting pending' do
- let(:params) { { scope: 'pending' } }
+ let(:params) { { status: 'pending' } }
it 'has only pending status' do
- expect(subject.map(&:status)).to include('pending')
+ expect(subject.map(&:status)).to all(eq('pending'))
end
end
context 'when selecting success' do
- let(:params) { { scope: 'success' } }
+ let(:params) { { status: 'success' } }
it 'has only success status' do
- expect(subject.map(&:status)).to include('success')
+ expect(subject.map(&:status)).to all(eq('success'))
end
end
context 'when selecting failed' do
- let(:params) { { scope: 'failed' } }
+ let(:params) { { status: 'failed' } }
it 'has only failed status' do
- expect(subject.map(&:status)).to include('failed')
+ expect(subject.map(&:status)).to all(eq('failed'))
end
end
context 'when selecting canceled' do
- let(:params) { { scope: 'canceled' } }
+ let(:params) { { status: 'canceled' } }
it 'has only canceled status' do
- expect(subject.map(&:status)).to include('canceled')
+ expect(subject.map(&:status)).to all(eq('canceled'))
end
end
context 'when selecting skipped' do
- let(:params) { { scope: 'skipped' } }
+ let(:params) { { status: 'skipped' } }
it 'has only skipped status' do
- expect(subject.map(&:status)).to include('skipped')
+ expect(subject.map(&:status)).to all(eq('skipped'))
end
end
end