mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Removing attr_accessible.
This commit is contained in:
parent
4b7aa5a2d0
commit
9643a5fa6d
7 changed files with 0 additions and 46 deletions
|
@ -31,7 +31,6 @@ module Devise
|
|||
|
||||
attr_reader :password
|
||||
attr_accessor :password_confirmation
|
||||
attr_accessible :email, :password, :password_confirmation
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -39,7 +39,6 @@ module Devise
|
|||
|
||||
# Remember me option available in after_authentication hook.
|
||||
attr_accessor :remember_me
|
||||
attr_accessible :remember_me
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -15,26 +15,6 @@ class AuthenticableTest < ActiveSupport::TestCase
|
|||
assert user.respond_to?(:password_confirmation)
|
||||
end
|
||||
|
||||
test 'should have email acessible' do
|
||||
assert field_accessible?(:email)
|
||||
end
|
||||
|
||||
test 'should have password acessible' do
|
||||
assert field_accessible?(:password)
|
||||
end
|
||||
|
||||
test 'should have password confirmation accessible' do
|
||||
assert field_accessible?(:password_confirmation)
|
||||
end
|
||||
|
||||
test 'should not have password salt accessible' do
|
||||
assert_not field_accessible?(:password_salt)
|
||||
end
|
||||
|
||||
test 'should not have encrypted password accessible' do
|
||||
assert_not field_accessible?(:encrypted_password)
|
||||
end
|
||||
|
||||
test 'should generate salt while setting password' do
|
||||
assert_present new_user.password_salt
|
||||
assert_present new_user(:password => nil).password_salt
|
||||
|
|
|
@ -6,18 +6,6 @@ class ConfirmableTest < ActiveSupport::TestCase
|
|||
setup_mailer
|
||||
end
|
||||
|
||||
test 'should not have confirmed at accessible' do
|
||||
assert_not field_accessible?(:confirmed_at)
|
||||
end
|
||||
|
||||
test 'should not have confirmation token accessible' do
|
||||
assert_not field_accessible?(:confirmation_token)
|
||||
end
|
||||
|
||||
test 'should not have confirmation sent at accessible' do
|
||||
assert_not field_accessible?(:confirmation_sent_at)
|
||||
end
|
||||
|
||||
test 'should generate confirmation token after creating a record' do
|
||||
assert_nil new_user.confirmation_token
|
||||
assert_not_nil create_user.confirmation_token
|
||||
|
|
|
@ -6,10 +6,6 @@ class RecoverableTest < ActiveSupport::TestCase
|
|||
setup_mailer
|
||||
end
|
||||
|
||||
test 'should not have reset password token accessible' do
|
||||
assert_not field_accessible?(:reset_password_token)
|
||||
end
|
||||
|
||||
test 'should not generate reset password token after creating a record' do
|
||||
assert_nil new_user.reset_password_token
|
||||
assert_nil create_user.reset_password_token
|
||||
|
|
|
@ -11,10 +11,6 @@ class RememberableTest < ActiveSupport::TestCase
|
|||
assert user.respond_to?(:remember_me)
|
||||
end
|
||||
|
||||
test 'should have remember_me accessible' do
|
||||
assert field_accessible?(:remember_me)
|
||||
end
|
||||
|
||||
test 'remember_me should generate a new token and save the record without validating' do
|
||||
user = create_user
|
||||
user.expects(:valid?).never
|
||||
|
|
|
@ -33,8 +33,4 @@ class ActiveSupport::TestCase
|
|||
def create_user(attributes={})
|
||||
User.create!(valid_attributes(attributes))
|
||||
end
|
||||
|
||||
def field_accessible?(field)
|
||||
new_user(field => 'test').send(field) == 'test'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue