From: Toshi MARUYAMA Date: Sat, 26 Oct 2019 12:54:00 +0000 (+0000) Subject: code cleanup: rubocop: revert r18854 X-Git-Tag: 4.1.0~235 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a54f13888bf86bfc72077dc34a7c219f5543c764;p=redmine.git code cleanup: rubocop: revert r18854 git-svn-id: http://svn.redmine.org/redmine/trunk@18868 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- 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