From 13285d7ef3ffa26ad6275647efbb86740254665b Mon Sep 17 00:00:00 2001 From: Lucas Mazza Date: Mon, 2 May 2016 10:46:57 -0300 Subject: [PATCH] Remove a few Ruby syntax warnings from the test suite. --- test/controllers/sessions_controller_test.rb | 2 +- test/generators/active_record_generator_test.rb | 2 +- test/integration/authenticatable_test.rb | 6 +++--- test/integration/confirmable_test.rb | 4 ++-- test/integration/lockable_test.rb | 2 +- test/integration/recoverable_test.rb | 4 ++-- test/integration/rememberable_test.rb | 4 ++-- test/rails_app/app/controllers/application_controller.rb | 3 +-- 8 files changed, 13 insertions(+), 14 deletions(-) diff --git a/test/controllers/sessions_controller_test.rb b/test/controllers/sessions_controller_test.rb index c224983a..6d28c6d9 100644 --- a/test/controllers/sessions_controller_test.rb +++ b/test/controllers/sessions_controller_test.rb @@ -6,7 +6,7 @@ class SessionsControllerTest < Devise::ControllerTestCase test "#create doesn't raise unpermitted params when sign in fails" do begin - subscriber = ActiveSupport::Notifications.subscribe /unpermitted_parameters/ do |name, start, finish, id, payload| + subscriber = ActiveSupport::Notifications.subscribe %r{unpermitted_parameters} do |name, start, finish, id, payload| flunk "Unpermitted params: #{payload}" end request.env["devise.mapping"] = Devise.mappings[:user] diff --git a/test/generators/active_record_generator_test.rb b/test/generators/active_record_generator_test.rb index adfa8fd1..79fab2b1 100644 --- a/test/generators/active_record_generator_test.rb +++ b/test/generators/active_record_generator_test.rb @@ -74,7 +74,7 @@ if DEVISE_ORM == :active_record assert_file "app/models/rails_engine/monster.rb", /devise/ assert_file "app/models/rails_engine/monster.rb" do |content| - assert_no_match /attr_accessible :email/, content + assert_no_match %r{attr_accessible :email}, content end end end diff --git a/test/integration/authenticatable_test.rb b/test/integration/authenticatable_test.rb index 099206f7..e85ae666 100644 --- a/test/integration/authenticatable_test.rb +++ b/test/integration/authenticatable_test.rb @@ -365,7 +365,7 @@ class AuthenticationWithScopedViewsTest < Devise::IntegrationTest assert_raise Webrat::NotFoundError do sign_in_as_user end - assert_match /Special user view/, response.body + assert_match %r{Special user view}, response.body end end @@ -376,7 +376,7 @@ class AuthenticationWithScopedViewsTest < Devise::IntegrationTest sign_in_as_user end - assert_match /Special user view/, response.body + assert_match %r{Special user view}, response.body assert !Devise::PasswordsController.scoped_views? ensure Devise::SessionsController.send :remove_instance_variable, :@scoped_views @@ -449,7 +449,7 @@ class AuthenticationOthersTest < Devise::IntegrationTest test 'sign in stub in xml format' do get new_user_session_path(format: 'xml') assert_match '', response.body - assert_match /.*<\/user>/m, response.body + assert_match %r{.*}m, response.body assert_match '', response.body assert_match '