summaryrefslogtreecommitdiff
path: root/spec/helpers/search_helper_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-02-18 10:34:06 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-02-18 10:34:06 +0000
commit859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch)
treed7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /spec/helpers/search_helper_spec.rb
parent446d496a6d000c73a304be52587cd9bbc7493136 (diff)
downloadgitlab-ce-859a6fb938bb9ee2a317c46dfa4fcc1af49608f0.tar.gz
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'spec/helpers/search_helper_spec.rb')
-rw-r--r--spec/helpers/search_helper_spec.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/helpers/search_helper_spec.rb b/spec/helpers/search_helper_spec.rb
index 2cb9d66ac63..a977f2c88c6 100644
--- a/spec/helpers/search_helper_spec.rb
+++ b/spec/helpers/search_helper_spec.rb
@@ -610,4 +610,35 @@ 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'
+ }
+ },
+ {
+ title: _('Last updated'),
+ sortable: true,
+ sortParam: {
+ asc: 'updated_asc',
+ desc: 'updated_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