diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-04-06 16:57:44 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-04-06 16:57:44 +0000 |
commit | dd37b8cfb64cac1ace72b1f471ed365df3dfc051 (patch) | |
tree | ac2cf0bef50d18ef6f8b9b636577ec5cce4cd8b4 /test/unit | |
parent | 8813de93b360cf3f4940e8fba089a9ffa0cf9c9d (diff) | |
download | redmine-dd37b8cfb64cac1ace72b1f471ed365df3dfc051.tar.gz redmine-dd37b8cfb64cac1ace72b1f471ed365df3dfc051.zip |
Fixed that related to "no open issues" filter shows all issues (#25478).
Patch by Kevin Fischer.
git-svn-id: http://svn.redmine.org/redmine/trunk@16504 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/query_test.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb index 885c30caa..09d9508d6 100644 --- a/test/unit/query_test.rb +++ b/test/unit/query_test.rb @@ -1100,7 +1100,7 @@ class QueryTest < ActiveSupport::TestCase assert_include 2, ids end - def test_filter_on_relations_with_no_open_issues + def test_filter_on_blocked_by_no_open_issues IssueRelation.delete_all # Issue 1 is blocked by 8, which is closed IssueRelation.create!(:relation_type => "blocked", :issue_from => Issue.find(1), :issue_to => Issue.find(8)) @@ -1114,6 +1114,20 @@ class QueryTest < ActiveSupport::TestCase assert_include 1, ids end + def test_filter_on_related_with_no_open_issues + IssueRelation.delete_all + # Issue 1 is blocked by 8, which is closed + IssueRelation.create!(relation_type: 'relates', issue_from: Issue.find(1), issue_to: Issue.find(8)) + # Issue 2 is blocked by 3, which is open + IssueRelation.create!(relation_type: 'relates', issue_from: Issue.find(2), issue_to: Issue.find(3)) + + query = IssueQuery.new(:name => '_') + query.filters = { 'relates' => { operator: '!o', values: [''] } } + ids = find_issues_with_query(query).map(&:id) + assert_equal [], ids & [2] + assert_include 1, ids + end + def test_filter_on_relations_with_no_issues IssueRelation.delete_all IssueRelation.create!(:relation_type => "relates", :issue_from => Issue.find(1), :issue_to => Issue.find(2)) |