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:
Diffstat (limited to 'spec/finders/tags_finder_spec.rb')
-rw-r--r--spec/finders/tags_finder_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/finders/tags_finder_spec.rb b/spec/finders/tags_finder_spec.rb
index acc86547271..70d79ced81d 100644
--- a/spec/finders/tags_finder_spec.rb
+++ b/spec/finders/tags_finder_spec.rb
@@ -32,6 +32,14 @@ RSpec.describe TagsFinder do
expect(load_tags(params).first.name).to eq('v1.0.0')
end
+
+ context 'when sort is not a string' do
+ it 'ignores sort parameter' do
+ params = { sort: { 'invalid' => 'string' } }
+
+ expect(load_tags(params).first.name).to eq('v1.0.0')
+ end
+ end
end
context 'filter only' do
@@ -70,6 +78,13 @@ RSpec.describe TagsFinder do
result = load_tags({ search: 'nope$' })
expect(result.count).to eq(0)
end
+
+ context 'when search is not a string' do
+ it 'returns no matches' do
+ result = load_tags({ search: { 'a' => 'b' } })
+ expect(result.count).to eq(0)
+ end
+ end
end
context 'filter and sort' do