summaryrefslogtreecommitdiffstats
path: root/test/unit/query_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-10-26 12:54:00 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-10-26 12:54:00 +0000
commita54f13888bf86bfc72077dc34a7c219f5543c764 (patch)
tree4710d0de40e3afa1db474a2681a77d4e956f1df2 /test/unit/query_test.rb
parent6f293870eb29141b55fa30e4247dd9903675647c (diff)
downloadredmine-a54f13888bf86bfc72077dc34a7c219f5543c764.tar.gz
redmine-a54f13888bf86bfc72077dc34a7c219f5543c764.zip
code cleanup: rubocop: revert r18854
git-svn-id: http://svn.redmine.org/redmine/trunk@18868 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/query_test.rb')
-rw-r--r--test/unit/query_test.rb24
1 files changed, 12 insertions, 12 deletions
diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb
index 671cb0b11..0fa9cf510 100644
--- a/test/unit/query_test.rb
+++ b/test/unit/query_test.rb
@@ -67,7 +67,7 @@ class QueryTest < ActiveSupport::TestCase
"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
@@ -85,7 +85,7 @@ class QueryTest < ActiveSupport::TestCase
"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
@@ -105,7 +105,7 @@ class QueryTest < ActiveSupport::TestCase
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
@@ -896,7 +896,7 @@ class QueryTest < ActiveSupport::TestCase
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
@@ -915,7 +915,7 @@ class QueryTest < ActiveSupport::TestCase
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
@@ -927,7 +927,7 @@ class QueryTest < ActiveSupport::TestCase
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
@@ -940,7 +940,7 @@ class QueryTest < ActiveSupport::TestCase
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
@@ -2042,7 +2042,7 @@ class QueryTest < ActiveSupport::TestCase
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
@@ -2052,14 +2052,14 @@ class QueryTest < ActiveSupport::TestCase
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
@@ -2108,7 +2108,7 @@ class QueryTest < ActiveSupport::TestCase
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