summaryrefslogtreecommitdiff
path: root/spec/helpers/search_helper_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-02-02 18:09:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-02-02 18:09:42 +0000
commit2d66c59d593354aa98785899cc8d5e640f62a012 (patch)
treeb0f82a38ffba401a1ad448983785660038c4cf4b /spec/helpers/search_helper_spec.rb
parentdab865db1e85e2fc3dd29dae8dc6b8e11b1ba3f7 (diff)
downloadgitlab-ce-2d66c59d593354aa98785899cc8d5e640f62a012.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers/search_helper_spec.rb')
-rw-r--r--spec/helpers/search_helper_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/helpers/search_helper_spec.rb b/spec/helpers/search_helper_spec.rb
index 2cb9d66ac63..80401635b95 100644
--- a/spec/helpers/search_helper_spec.rb
+++ b/spec/helpers/search_helper_spec.rb
@@ -610,4 +610,25 @@ RSpec.describe SearchHelper do
end
end
end
+
+ describe '#search_sort_options' do
+ let(:user) { create(:user) }
+
+ mock_created_sort = {
+ title: _('Created date'),
+ sortable: true,
+ sortParam: {
+ asc: 'created_asc',
+ desc: 'created_desc'
+ }
+ }
+
+ before do
+ allow(self).to receive(:current_user).and_return(user)
+ end
+
+ it 'returns the correct data' do
+ expect(search_sort_options).to eq([mock_created_sort])
+ end
+ end
end