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/lib/gitlab/empty_search_results_spec.rb')
-rw-r--r--spec/lib/gitlab/empty_search_results_spec.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/lib/gitlab/empty_search_results_spec.rb b/spec/lib/gitlab/empty_search_results_spec.rb
new file mode 100644
index 00000000000..e79586bef68
--- /dev/null
+++ b/spec/lib/gitlab/empty_search_results_spec.rb
@@ -0,0 +1,31 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Gitlab::EmptySearchResults do
+ subject { described_class.new }
+
+ describe '#objects' do
+ it 'returns an empty array' do
+ expect(subject.objects).to match_array([])
+ end
+ end
+
+ describe '#formatted_count' do
+ it 'returns a zero' do
+ expect(subject.formatted_count).to eq('0')
+ end
+ end
+
+ describe '#highlight_map' do
+ it 'returns an empty hash' do
+ expect(subject.highlight_map).to eq({})
+ end
+ end
+
+ describe '#aggregations' do
+ it 'returns an empty array' do
+ expect(subject.objects).to match_array([])
+ end
+ end
+end