summaryrefslogtreecommitdiffstats
path: root/test/helpers/search_helper_test.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-04-27 04:10:33 +0000
committerGo MAEDA <maeda@farend.jp>2023-04-27 04:10:33 +0000
commitccf8e7d2998f40e4673e88fa98d0c6bc89306800 (patch)
tree8506d4b79a56cd244d949e307cdfa3f95853173e /test/helpers/search_helper_test.rb
parent135606bcf5d17bc5050893edc7243186374ba4ee (diff)
downloadredmine-ccf8e7d2998f40e4673e88fa98d0c6bc89306800.tar.gz
redmine-ccf8e7d2998f40e4673e88fa98d0c6bc89306800.zip
Add a button to apply issues filter to search results (#38481).
Patch by Go MAEDA. git-svn-id: https://svn.redmine.org/redmine/trunk@22212 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/helpers/search_helper_test.rb')
-rw-r--r--test/helpers/search_helper_test.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/helpers/search_helper_test.rb b/test/helpers/search_helper_test.rb
index 33fe56a7b..12b8fa82f 100644
--- a/test/helpers/search_helper_test.rb
+++ b/test/helpers/search_helper_test.rb
@@ -54,4 +54,36 @@ class SearchHelperTest < Redmine::HelperTest
r
)
end
+
+ def test_issues_filter_path
+ # rubocop:disable Layout/LineLength
+ assert_equal(
+ '/issues?f[]=status_id&f[]=any_searchable&f[]=project_id&op[any_searchable]=*~&op[project_id]==&op[status_id]=*&set_filter=1&sort=updated_on:desc&v[any_searchable][]=recipe&v[project_id][]=mine',
+ Addressable::URI.unencode(issues_filter_path('recipe', projects_scope: 'my_projects'))
+ )
+ assert_equal(
+ '/issues?f[]=status_id&f[]=any_searchable&f[]=project_id&op[any_searchable]=*~&op[project_id]==&op[status_id]=*&set_filter=1&sort=updated_on:desc&v[any_searchable][]=recipe&v[project_id][]=bookmarks',
+ Addressable::URI.unencode(issues_filter_path('recipe', projects_scope: 'bookmarks'))
+ )
+ assert_equal(
+ '/issues?f[]=status_id&f[]=any_searchable&op[any_searchable]=*~&op[status_id]=*&set_filter=1&sort=updated_on:desc&v[any_searchable][]=recipe',
+ Addressable::URI.unencode(issues_filter_path('recipe', projects_scope: 'all'))
+ )
+ # f[]=subject
+ assert_equal(
+ '/issues?f[]=status_id&f[]=subject&op[status_id]=*&op[subject]=*~&set_filter=1&sort=updated_on:desc&v[subject][]=recipe',
+ Addressable::URI.unencode(issues_filter_path('recipe', projects_scope: 'all', titles_only: '1'))
+ )
+ # op[subject]=~ (contains)
+ assert_equal(
+ '/issues?f[]=status_id&f[]=subject&op[status_id]=*&op[subject]=~&set_filter=1&sort=updated_on:desc&v[subject][]=recipe',
+ Addressable::URI.unencode(issues_filter_path('recipe', projects_scope: 'all', titles_only: '1', all_words: ''))
+ )
+ # op[status_id]=o (open)
+ assert_equal(
+ '/issues?f[]=status_id&f[]=subject&op[status_id]=o&op[subject]=*~&set_filter=1&sort=updated_on:desc&v[subject][]=recipe',
+ Addressable::URI.unencode(issues_filter_path('recipe', projects_scope: 'all', titles_only: '1', open_issues: '1'))
+ )
+ # rubocop:enable Layout/LineLength
+ end
end