1041 |
1041 |
assert_equal [1, 3], result.map(&:id).sort
|
1042 |
1042 |
end
|
1043 |
1043 |
|
|
1044 |
def test_filter_any_searchable_with_my_projects
|
|
1045 |
# This user's project is ecookbook only
|
|
1046 |
User.current = User.find_by(login: 'dlopper')
|
|
1047 |
query = IssueQuery.new(
|
|
1048 |
:name => '_',
|
|
1049 |
:filters => {
|
|
1050 |
'any_searchable' => {:operator => '~', :values => ['issue']},
|
|
1051 |
'project_id' => {:operator => '=', :values => ['mine']}
|
|
1052 |
}
|
|
1053 |
)
|
|
1054 |
result = find_issues_with_query(query)
|
|
1055 |
assert_equal [7, 8, 11, 12], result.map(&:id).sort
|
|
1056 |
result.each {|issue| assert_equal 1, issue.project_id}
|
|
1057 |
end
|
|
1058 |
|
|
1059 |
def test_filter_any_searchable_with_my_bookmarks
|
|
1060 |
# This user bookmarks two projects, ecookbook and private-child
|
|
1061 |
User.current = User.find(1)
|
|
1062 |
query = IssueQuery.new(
|
|
1063 |
:name => '_',
|
|
1064 |
:filters => {
|
|
1065 |
'any_searchable' => {:operator => '~', :values => ['issue']},
|
|
1066 |
'project_id' => {:operator => '=', :values => ['bookmarks']}
|
|
1067 |
}
|
|
1068 |
)
|
|
1069 |
result = find_issues_with_query(query)
|
|
1070 |
assert_equal [6, 7, 8, 9, 10, 11, 12], result.map(&:id).sort
|
|
1071 |
result.each {|issue| assert_includes [1, 5], issue.project_id}
|
|
1072 |
end
|
|
1073 |
|
1044 |
1074 |
def test_filter_updated_by
|
1045 |
1075 |
user = User.generate!
|
1046 |
1076 |
Journal.create!(:user_id => user.id, :journalized => Issue.find(2), :notes => 'Notes')
|