diff options
author | Go MAEDA <maeda@farend.jp> | 2021-12-29 06:12:27 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2021-12-29 06:12:27 +0000 |
commit | b6a26a60f3d425f340adc76e27d38c19505f254c (patch) | |
tree | 14475ea267754be1db511bff8ea1cfbf8901faef /test/functional | |
parent | 52aef905ff92ebb34b7b6dbf870405f2351b41b4 (diff) | |
download | redmine-b6a26a60f3d425f340adc76e27d38c19505f254c.tar.gz redmine-b6a26a60f3d425f340adc76e27d38c19505f254c.zip |
Fixes for Performance/StringIdentifierArgument introduced in RuboCop Performance 1.13.0 (#35142).
git-svn-id: http://svn.redmine.org/redmine/trunk@21330 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/issues_controller_test.rb | 6 | ||||
-rw-r--r-- | test/functional/my_controller_test.rb | 8 | ||||
-rw-r--r-- | test/functional/projects_controller_test.rb | 4 | ||||
-rw-r--r-- | test/functional/roles_controller_test.rb | 2 | ||||
-rw-r--r-- | test/functional/timelog_controller_test.rb | 18 |
5 files changed, 19 insertions, 19 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 52b63f1e0..2348c462e 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -2375,11 +2375,11 @@ class IssuesControllerTest < Redmine::ControllerTest assert_select 'div#issue_tree span.issues-stat' do assert_select 'span.badge', text: '4' assert_select 'span.open a', text: '3 open' - assert_equal CGI.unescape(css_select('span.open a').first.attr('href')), + assert_equal CGI.unescape(css_select('span.open a').first.attr(:href)), "/issues?parent_id=~1&set_filter=true&status_id=o" assert_select 'span.closed a', text: '1 closed' - assert_equal CGI.unescape(css_select('span.closed a').first.attr('href')), + assert_equal CGI.unescape(css_select('span.closed a').first.attr(:href)), "/issues?parent_id=~1&set_filter=true&status_id=c" end end @@ -2392,7 +2392,7 @@ class IssuesControllerTest < Redmine::ControllerTest assert_select 'div#issue_tree span.issues-stat' do assert_select 'span.open a', text: '1 open' - assert_equal CGI.unescape(css_select('span.open a').first.attr('href')), + assert_equal CGI.unescape(css_select('span.open a').first.attr(:href)), "/issues?parent_id=~1&set_filter=true&status_id=o" assert_select 'span.closed', text: '0 closed' assert_select 'span.closed a', 0 diff --git a/test/functional/my_controller_test.rb b/test/functional/my_controller_test.rb index 6e93e3303..cc0be81c7 100644 --- a/test/functional/my_controller_test.rb +++ b/test/functional/my_controller_test.rb @@ -265,7 +265,7 @@ class MyControllerTest < Redmine::ControllerTest assert_response :success assert_select '#block-issuesupdatedbyme' do - report_url = CGI.unescape(css_select('h3 a').first.attr('href')) + report_url = CGI.unescape(css_select('h3 a').first.attr(:href)) assert_match 'f[]=project.status', report_url assert_match 'v[project.status][]=1', report_url assert_match 'f[]=updated_by', report_url @@ -306,7 +306,7 @@ class MyControllerTest < Redmine::ControllerTest assert_response :success assert_select '#block-issuesassignedtome table.issues tbody' do - report_url = css_select('h3 a').map {|e| e.attr('href')}.first + report_url = css_select('h3 a').map {|e| e.attr(:href)}.first assert_match 'f%5B%5D=project.status', report_url assert_match 'v%5Bproject.status%5D%5B%5D=1', report_url @@ -334,7 +334,7 @@ class MyControllerTest < Redmine::ControllerTest assert_response :success assert_select '#block-issuesreportedbyme' do - report_url = css_select('h3 a').map {|e| e.attr('href')}.first + report_url = css_select('h3 a').map {|e| e.attr(:href)}.first assert_match 'f%5B%5D=project.status', report_url assert_match 'v%5Bproject.status%5D%5B%5D=1', report_url @@ -366,7 +366,7 @@ class MyControllerTest < Redmine::ControllerTest assert_response :success assert_select '#block-issueswatched table.issues tbody' do - report_url = css_select('h3 a').map {|e| e.attr('href')}.first + report_url = css_select('h3 a').map {|e| e.attr(:href)}.first assert_match 'f%5B%5D=project.status', report_url assert_match 'v%5Bproject.status%5D%5B%5D=1', report_url diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index a26793a20..38d70150c 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -139,8 +139,8 @@ class ProjectsControllerTest < Redmine::ControllerTest } assert_response :success - child_level1 = css_select('tr#project-5').map {|e| e.attr('class')}.first.split(' ') - child_level2 = css_select('tr#project-6').map {|e| e.attr('class')}.first.split(' ') + child_level1 = css_select('tr#project-5').map {|e| e.attr(:class)}.first.split(' ') + child_level2 = css_select('tr#project-6').map {|e| e.attr(:class)}.first.split(' ') assert_include 'idnt', child_level1 assert_include 'idnt-1', child_level1 diff --git a/test/functional/roles_controller_test.rb b/test/functional/roles_controller_test.rb index c1bb859a4..20baae6f9 100644 --- a/test/functional/roles_controller_test.rb +++ b/test/functional/roles_controller_test.rb @@ -71,7 +71,7 @@ class RolesControllerTest < Redmine::ControllerTest assert_response :success assert_equal( %w(view_documents view_issues), - css_select('input[name="role[permissions][]"][checked=checked]').map {|e| e.attr('value')}.sort + css_select('input[name="role[permissions][]"][checked=checked]').map {|e| e.attr(:value)}.sort ) end diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb index b1a4899cc..bdfbf0cfc 100644 --- a/test/functional/timelog_controller_test.rb +++ b/test/functional/timelog_controller_test.rb @@ -1165,7 +1165,7 @@ class TimelogControllerTest < Redmine::ControllerTest assert_response :success assert_equal( [t2, t1, t3].map(&:id).map(&:to_s), - css_select('input[name="ids[]"]').map {|e| e.attr('value')} + css_select('input[name="ids[]"]').map {|e| e.attr(:value)} ) get( :index, @@ -1180,7 +1180,7 @@ class TimelogControllerTest < Redmine::ControllerTest assert_response :success assert_equal( [t3, t1, t2].map(&:id).map(&:to_s), - css_select('input[name="ids[]"]').map {|e| e.attr('value')} + css_select('input[name="ids[]"]').map {|e| e.attr(:value)} ) end @@ -1206,7 +1206,7 @@ class TimelogControllerTest < Redmine::ControllerTest get :index, :params => params.dup.merge(sort_criteria) assert_response :success expected_ids = expected.map(&:id).map(&:to_s) - actual_ids = css_select('input[name="ids[]"]').map {|e| e.attr('value')} + actual_ids = css_select('input[name="ids[]"]').map {|e| e.attr(:value)} assert_equal expected_ids, actual_ids end end @@ -1242,7 +1242,7 @@ class TimelogControllerTest < Redmine::ControllerTest } ) assert_response :success - assert_equal [entry].map(&:id).map(&:to_s), css_select('input[name="ids[]"]').map {|e| e.attr('value')} + assert_equal [entry].map(&:id).map(&:to_s), css_select('input[name="ids[]"]').map {|e| e.attr(:value)} end def test_index_with_project_status_filter @@ -1261,7 +1261,7 @@ class TimelogControllerTest < Redmine::ControllerTest ) assert_response :success - time_entries = css_select('input[name="ids[]"]').map {|e| e.attr('value')} + time_entries = css_select('input[name="ids[]"]').map {|e| e.attr(:value)} assert_include '1', time_entries assert_not_include '4', time_entries end @@ -1308,7 +1308,7 @@ class TimelogControllerTest < Redmine::ControllerTest :v => {'issue.tracker_id' => ['2']} } assert_response :success - assert_equal [entry].map(&:id).map(&:to_s), css_select('input[name="ids[]"]').map {|e| e.attr('value')} + assert_equal [entry].map(&:id).map(&:to_s), css_select('input[name="ids[]"]').map {|e| e.attr(:value)} end def test_index_with_issue_tracker_column @@ -1348,7 +1348,7 @@ class TimelogControllerTest < Redmine::ControllerTest :v => {'issue.category_id' => ['1']} } assert_response :success - assert_equal ['1', '2'], css_select('input[name="ids[]"]').map {|e| e.attr('value')} + assert_equal ['1', '2'], css_select('input[name="ids[]"]').map {|e| e.attr(:value)} end def test_index_with_issue_category_column @@ -1383,7 +1383,7 @@ class TimelogControllerTest < Redmine::ControllerTest :v => {'author_id' => ['2']} } assert_response :success - assert_equal ['1'], css_select('input[name="ids[]"]').map {|e| e.attr('value')} + assert_equal ['1'], css_select('input[name="ids[]"]').map {|e| e.attr(:value)} end def test_index_with_author_column @@ -1447,7 +1447,7 @@ class TimelogControllerTest < Redmine::ControllerTest assert_response :success assert_equal( [entry].map(&:id).map(&:to_s), - css_select('input[name="ids[]"]').map {|e| e.attr('value')} + css_select('input[name="ids[]"]').map {|e| e.attr(:value)} ) end |