Skip to content

Commit

Permalink
Use minitest helpers to check if objects respond to certain methods
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosantoniodasilva committed Mar 22, 2021
1 parent 0cd72a5 commit ef9a2f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions test/models/database_authenticatable_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def setup

test 'should respond to password and password confirmation' do
user = new_user
assert user.respond_to?(:password)
assert user.respond_to?(:password_confirmation)
assert_respond_to user, :password
assert_respond_to user, :password_confirmation
end

test 'should generate a hashed password while setting password' do
Expand Down Expand Up @@ -149,7 +149,7 @@ def setup
end

test 'should respond to current password' do
assert new_user.respond_to?(:current_password)
assert_respond_to new_user, :current_password
end

test 'should update password with valid current password' do
Expand Down
4 changes: 2 additions & 2 deletions test/models/rememberable_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ def user.authenticatable_salt; ""; end
end

test 'should respond to remember_me attribute' do
assert resource_class.new.respond_to?(:remember_me)
assert resource_class.new.respond_to?(:remember_me=)
assert_respond_to resource_class.new, :remember_me
assert_respond_to resource_class.new, :remember_me=
end

test 'forget_me should clear remember_created_at if expire_all_remember_me_on_sign_out is true' do
Expand Down

0 comments on commit ef9a2f4

Please sign in to comment.