diff options
Diffstat (limited to 'test/unit/query_test.rb')
-rw-r--r-- | test/unit/query_test.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb index 55500ff13..f58cd142d 100644 --- a/test/unit/query_test.rb +++ b/test/unit/query_test.rb @@ -736,6 +736,37 @@ class QueryTest < ActiveSupport::TestCase assert_not_include issue, result end + def test_operator_contains_any_of + User.current = User.find(1) + query = IssueQuery.new( + :name => '_', + :filters => { + 'subject' => { + :operator => '|~', + :values => ['close block'] + } + } + ) + result = find_issues_with_query(query) + assert_equal [8, 9, 10, 11, 12], result.map(&:id).sort + result.each {|issue| assert issue.subject =~ /(close|block)/i} + end + + def test_operator_contains_any_of_with_any_searchable_text + User.current = User.find(1) + query = IssueQuery.new( + :name => '_', + :filters => { + 'any_searchable' => { + :operator => '|~', + :values => ['recipe categories'] + } + } + ) + result = find_issues_with_query(query) + assert_equal [1, 2, 3], result.map(&:id).sort + end + def test_range_for_this_week_with_week_starting_on_monday I18n.locale = :fr assert_equal '1', I18n.t(:general_first_day_of_week) |