diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index a5d9b2e6b..992d9ece9 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -559,14 +559,6 @@ Performance/RedundantSplitRegexpArgument: Exclude: - 'lib/redmine/wiki_formatting/textile/redcloth3.rb' -# This cop supports unsafe autocorrection (--autocorrect-all). -Performance/StringInclude: - Exclude: - - 'test/functional/versions_controller_test.rb' - - 'test/integration/sessions_test.rb' - - 'test/unit/lib/redmine/scm/adapters/bazaar_adapter_test.rb' - - 'test/unit/lib/redmine/wiki_formatting/macros_test.rb' - # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: OnlySumOrWithInitialValue. Performance/Sum: diff --git a/test/functional/versions_controller_test.rb b/test/functional/versions_controller_test.rb index fdd767560..d872f62eb 100644 --- a/test/functional/versions_controller_test.rb +++ b/test/functional/versions_controller_test.rb @@ -336,7 +336,7 @@ class VersionsControllerTest < Redmine::ControllerTest end assert_redirected_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => 'ecookbook' - assert flash[:error].match(/Unable to delete version/) + assert flash[:error].include?('Unable to delete version') assert Version.find_by_id(2) end diff --git a/test/integration/sessions_test.rb b/test/integration/sessions_test.rb index 93b8988c5..e78de7f26 100644 --- a/test/integration/sessions_test.rb +++ b/test/integration/sessions_test.rb @@ -39,7 +39,7 @@ class SessionsTest < Redmine::IntegrationTest get '/my/account' assert_response 302 - assert flash[:error].match(/Your session has expired/) + assert flash[:error].include?('Your session has expired') end def test_lock_user_kills_sessions @@ -51,7 +51,7 @@ class SessionsTest < Redmine::IntegrationTest get '/my/account' assert_response 302 - assert flash[:error].match(/Your session has expired/) + assert flash[:error].include?('Your session has expired') end def test_update_user_does_not_kill_sessions diff --git a/test/unit/lib/redmine/scm/adapters/bazaar_adapter_test.rb b/test/unit/lib/redmine/scm/adapters/bazaar_adapter_test.rb index 0bef95141..16e5c1895 100644 --- a/test/unit/lib/redmine/scm/adapters/bazaar_adapter_test.rb +++ b/test/unit/lib/redmine/scm/adapters/bazaar_adapter_test.rb @@ -42,7 +42,7 @@ class BazaarAdapterTest < ActiveSupport::TestCase def test_cat cat = @adapter.cat('directory/document.txt') - assert cat =~ /Write the contents of a file as of a given revision to standard output/ + assert cat.include?('Write the contents of a file as of a given revision to standard output') end def test_cat_path_invalid diff --git a/test/unit/lib/redmine/wiki_formatting/macros_test.rb b/test/unit/lib/redmine/wiki_formatting/macros_test.rb index 28be28d47..278a6815e 100644 --- a/test/unit/lib/redmine/wiki_formatting/macros_test.rb +++ b/test/unit/lib/redmine/wiki_formatting/macros_test.rb @@ -211,7 +211,7 @@ class Redmine::WikiFormatting::MacrosTest < Redmine::HelperTest def test_macro_hello_world text = "{{hello_world}}" - assert textilizable(text).match(/Hello world!/) + assert textilizable(text).include?('Hello world!') end def test_macro_hello_world_should_escape_arguments