debian-mirror-gitlab/debian/patches/0200-remove-order-dependency-in-label-finder-spec.patch

69 lines
2.8 KiB
Diff
Raw Normal View History

2016-11-28 23:52:43 +05:30
From dfc0fc224f6d05a4680940e7a8802819a68a3043 Mon Sep 17 00:00:00 2001
From: Nick Thomas <nick@gitlab.com>
Date: Mon, 28 Nov 2016 12:21:55 +0000
Subject: [PATCH] Remove an order dependency in LabelFinder specs
---
spec/finders/labels_finder_spec.rb | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/spec/finders/labels_finder_spec.rb b/spec/finders/labels_finder_spec.rb
index 9085cc8..6fd2483 100644
--- a/spec/finders/labels_finder_spec.rb
+++ b/spec/finders/labels_finder_spec.rb
@@ -36,7 +36,7 @@ describe LabelsFinder do
finder = described_class.new(user)
- expect(finder.execute).to eq [group_label_2, group_label_3, project_label_1, group_label_1, project_label_2, project_label_4]
+ expect(finder.execute).to contain_exactly(group_label_2, group_label_3, project_label_1, group_label_1, project_label_2, project_label_4)
end
it 'returns labels available if nil title is supplied' do
@@ -44,7 +44,7 @@ describe LabelsFinder do
# params[:title] will return `nil` regardless whether it is specified
finder = described_class.new(user, title: nil)
- expect(finder.execute).to eq [group_label_2, group_label_3, project_label_1, group_label_1, project_label_2, project_label_4]
+ expect(finder.execute).to contain_exactly(group_label_2, group_label_3, project_label_1, group_label_1, project_label_2, project_label_4)
end
end
@@ -54,7 +54,7 @@ describe LabelsFinder do
finder = described_class.new(user, group_id: group_1.id)
- expect(finder.execute).to eq [group_label_2, project_label_1, group_label_1, project_label_5]
+ expect(finder.execute).to contain_exactly(group_label_2, project_label_1, group_label_1, project_label_5)
end
end
@@ -62,7 +62,7 @@ describe LabelsFinder do
it 'returns labels available for the project' do
finder = described_class.new(user, project_id: project_1.id)
- expect(finder.execute).to eq [group_label_2, project_label_1, group_label_1]
+ expect(finder.execute).to contain_exactly(group_label_2, project_label_1, group_label_1)
end
context 'as an administrator' do
@@ -85,13 +85,13 @@ describe LabelsFinder do
it 'returns label with that title' do
finder = described_class.new(user, title: 'Group Label 2')
- expect(finder.execute).to eq [group_label_2]
+ expect(finder.execute).to contain_exactly(group_label_2)
end
it 'returns label with title alias' do
finder = described_class.new(user, name: 'Group Label 2')
- expect(finder.execute).to eq [group_label_2]
+ expect(finder.execute).to contain_exactly(group_label_2)
end
it 'returns no labels if empty title is supplied' do
--
2.7.4