"Priority"
]
assert_equal expected_order,
- (query.available_filters.values.map{|v| v[:name]} & expected_order)
+ (query.available_filters.values.map {|v| v[:name]} & expected_order)
end
def test_available_filters_with_custom_fields_should_be_ordered
"Assignee's order test"
]
assert_equal expected_order,
- (query.available_filters.values.map{|v| v[:name]} & expected_order)
+ (query.available_filters.values.map {|v| v[:name]} & expected_order)
end
def test_custom_fields_for_all_projects_should_be_available_in_global_queries
query = IssueQuery.new(:project => nil, :name => '_')
project_filter = query.available_filters["project_id"]
assert_not_nil project_filter
- project_ids = project_filter[:values].map{|p| p[1]}
+ project_ids = project_filter[:values].map {|p| p[1]}
assert project_ids.include?("1") # public project
assert !project_ids.include?("2") # private project user cannot see
end
query = IssueQuery.new(:name => '_', :project => Project.find(1))
filter = query.available_filters["cf_#{cf.id}"]
assert_not_nil filter
- assert_include 'me', filter[:values].map{|v| v[1]}
+ assert_include 'me', filter[:values].map {|v| v[1]}
query.filters = { "cf_#{cf.id}" => {:operator => '=', :values => ['me']}}
result = query.issues
query = IssueQuery.new(:name => '_')
filter = query.available_filters['project_id']
assert_not_nil filter
- assert_include 'mine', filter[:values].map{|v| v[1]}
+ assert_include 'mine', filter[:values].map {|v| v[1]}
query.filters = { 'project_id' => {:operator => '=', :values => ['mine']}}
result = query.issues
query = ProjectQuery.new(:name => '_')
filter = query.available_filters['id']
assert_not_nil filter
- assert_include 'bookmarks', filter[:values].map{|v| v[1]}
+ assert_include 'bookmarks', filter[:values].map {|v| v[1]}
query.filters = { 'id' => {:operator => '=', :values => ['bookmarks']}}
result = query.results_scope
query = ProjectQuery.new(:name => '_')
filter = query.available_filters['id']
- assert_not_include 'bookmarks', filter[:values].map{|v| v[1]}
+ assert_not_include 'bookmarks', filter[:values].map {|v| v[1]}
end
def test_filter_watched_issues
test "#available_filters should include users of visible projects in cross-project view" do
users = IssueQuery.new.available_filters["assigned_to_id"]
assert_not_nil users
- assert users[:values].map{|u| u[1]}.include?("3")
+ assert users[:values].map {|u| u[1]}.include?("3")
end
test "#available_filters should include users of subprojects" do
Member.create!(:principal => user1, :project => project.children.visible.first, :role_ids => [1])
users = IssueQuery.new(:project => project).available_filters["assigned_to_id"]
assert_not_nil users
- assert users[:values].map{|u| u[1]}.include?(user1.id.to_s)
- assert !users[:values].map{|u| u[1]}.include?(user2.id.to_s)
+ assert users[:values].map {|u| u[1]}.include?(user1.id.to_s)
+ assert !users[:values].map {|u| u[1]}.include?(user2.id.to_s)
end
test "#available_filters should include visible projects in cross-project view" do
projects = IssueQuery.new.available_filters["project_id"]
assert_not_nil projects
- assert projects[:values].map{|u| u[1]}.include?("1")
+ assert projects[:values].map {|u| u[1]}.include?("1")
end
test "#available_filters should include 'member_of_group' filter" do
def test_available_columns_should_not_include_total_estimated_hours_when_trackers_disabled_estimated_hours
Tracker.visible.each do |tracker|
- tracker.core_fields = tracker.core_fields.reject{|field| field == 'estimated_hours'}
+ tracker.core_fields = tracker.core_fields.reject {|field| field == 'estimated_hours'}
tracker.save!
end
query = IssueQuery.new