Spaces
This commit is contained in:
parent
e1c3b915e7
commit
c9fe8885f9
|
@ -116,7 +116,7 @@ module Devise
|
||||||
# Time interval you can access your account before confirming your account.
|
# Time interval you can access your account before confirming your account.
|
||||||
mattr_accessor :confirm_within
|
mattr_accessor :confirm_within
|
||||||
@@confirm_within = 0.days
|
@@confirm_within = 0.days
|
||||||
|
|
||||||
# Defines which key will be used when confirming an account
|
# Defines which key will be used when confirming an account
|
||||||
mattr_accessor :confirmation_keys
|
mattr_accessor :confirmation_keys
|
||||||
@@confirmation_keys = [ :email ]
|
@@confirmation_keys = [ :email ]
|
||||||
|
|
|
@ -67,7 +67,7 @@ Devise.setup do |config|
|
||||||
|
|
||||||
# Defines which key will be used when confirming an account
|
# Defines which key will be used when confirming an account
|
||||||
# config.confirmation_keys = [ :email ]
|
# config.confirmation_keys = [ :email ]
|
||||||
|
|
||||||
# ==> Configuration for :rememberable
|
# ==> Configuration for :rememberable
|
||||||
# The time the user will be remembered without asking for credentials again.
|
# The time the user will be remembered without asking for credentials again.
|
||||||
# config.remember_for = 2.weeks
|
# config.remember_for = 2.weeks
|
||||||
|
|
|
@ -127,7 +127,7 @@ class ConfirmableTest < ActiveSupport::TestCase
|
||||||
User.send_confirmation_instructions(:email => user.email)
|
User.send_confirmation_instructions(:email => user.email)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
test 'should always have confirmation token when email is sent' do
|
test 'should always have confirmation token when email is sent' do
|
||||||
user = new_user
|
user = new_user
|
||||||
user.instance_eval { def confirmation_required?; false end }
|
user.instance_eval { def confirmation_required?; false end }
|
||||||
|
@ -210,7 +210,7 @@ class ConfirmableTest < ActiveSupport::TestCase
|
||||||
user.save
|
user.save
|
||||||
assert_not user.reload.active?
|
assert_not user.reload.active?
|
||||||
end
|
end
|
||||||
|
|
||||||
test 'should be active without confirmation when confirmation is not required' do
|
test 'should be active without confirmation when confirmation is not required' do
|
||||||
user = create_user
|
user = create_user
|
||||||
user.instance_eval { def confirmation_required?; false end }
|
user.instance_eval { def confirmation_required?; false end }
|
||||||
|
@ -218,7 +218,7 @@ class ConfirmableTest < ActiveSupport::TestCase
|
||||||
user.save
|
user.save
|
||||||
assert user.reload.active?
|
assert user.reload.active?
|
||||||
end
|
end
|
||||||
|
|
||||||
test 'should find a user to send email instructions for the user confirm it\'s email by authentication_keys' do
|
test 'should find a user to send email instructions for the user confirm it\'s email by authentication_keys' do
|
||||||
swap Devise, :authentication_keys => [:username, :email] do
|
swap Devise, :authentication_keys => [:username, :email] do
|
||||||
user = create_user
|
user = create_user
|
||||||
|
@ -226,13 +226,13 @@ class ConfirmableTest < ActiveSupport::TestCase
|
||||||
assert_equal confirm_user, user
|
assert_equal confirm_user, user
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
test 'should require all confirmation_keys' do
|
test 'should require all confirmation_keys' do
|
||||||
swap Devise, :confirmation_keys => [:username, :email] do
|
swap Devise, :confirmation_keys => [:username, :email] do
|
||||||
user = create_user
|
user = create_user
|
||||||
confirm_user = User.send_confirmation_instructions(:email => user.email)
|
confirm_user = User.send_confirmation_instructions(:email => user.email)
|
||||||
assert_not confirm_user.persisted?
|
assert_not confirm_user.persisted?
|
||||||
assert_equal "can't be blank", confirm_user.errors[:username].join
|
assert_equal "can't be blank", confirm_user.errors[:username].join
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -64,7 +64,7 @@ Devise.setup do |config|
|
||||||
|
|
||||||
# Defines which key will be used when confirming an account
|
# Defines which key will be used when confirming an account
|
||||||
# config.confirmation_keys = [ :email ]
|
# config.confirmation_keys = [ :email ]
|
||||||
|
|
||||||
# ==> Configuration for :rememberable
|
# ==> Configuration for :rememberable
|
||||||
# The time the user will be remembered without asking for credentials again.
|
# The time the user will be remembered without asking for credentials again.
|
||||||
# config.remember_for = 2.weeks
|
# config.remember_for = 2.weeks
|
||||||
|
|
Loading…
Reference in New Issue