Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2016-03-17 02:16:42 +0300
committerFelipe Artur <felipefac@gmail.com>2016-03-17 02:16:42 +0300
commit44c127447b5a3cfc7aaea6f19e18baf9f42ad500 (patch)
treef386dbb06fec8c5fdec92812394ac63cf67183a0 /spec/models/group_spec.rb
parentec20fdf366843e60ed30abb5322c3c1b8f471b4a (diff)
parent59064aeeef8562a87d4d03efa9b11012a007e261 (diff)
Merge 4009-external-users into issue_12658
Diffstat (limited to 'spec/models/group_spec.rb')
-rw-r--r--spec/models/group_spec.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb
index 25aa77dc4e8..135d298e10f 100644
--- a/spec/models/group_spec.rb
+++ b/spec/models/group_spec.rb
@@ -121,4 +121,30 @@ describe Group, models: true do
expect(group.avatar_type).to eq(["only images allowed"])
end
end
+
+ describe '.search' do
+ it 'returns groups with a matching name' do
+ expect(described_class.search(group.name)).to eq([group])
+ end
+
+ it 'returns groups with a partially matching name' do
+ expect(described_class.search(group.name[0..2])).to eq([group])
+ end
+
+ it 'returns groups with a matching name regardless of the casing' do
+ expect(described_class.search(group.name.upcase)).to eq([group])
+ end
+
+ it 'returns groups with a matching path' do
+ expect(described_class.search(group.path)).to eq([group])
+ end
+
+ it 'returns groups with a partially matching path' do
+ expect(described_class.search(group.path[0..2])).to eq([group])
+ end
+
+ it 'returns groups with a matching path regardless of the casing' do
+ expect(described_class.search(group.path.upcase)).to eq([group])
+ end
+ end
end