mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Switched all instances of 'not blank?' to 'present?'
This commit is contained in:
parent
081ea9e0ba
commit
f37b10ef87
5 changed files with 8 additions and 9 deletions
|
@ -236,17 +236,17 @@ module Devise
|
||||||
end
|
end
|
||||||
|
|
||||||
def postpone_email_change?
|
def postpone_email_change?
|
||||||
postpone = self.class.reconfirmable && email_changed? && !@bypass_confirmation_postpone && !self.email.blank?
|
postpone = self.class.reconfirmable && email_changed? && !@bypass_confirmation_postpone && self.email.present?
|
||||||
@bypass_confirmation_postpone = false
|
@bypass_confirmation_postpone = false
|
||||||
postpone
|
postpone
|
||||||
end
|
end
|
||||||
|
|
||||||
def reconfirmation_required?
|
def reconfirmation_required?
|
||||||
self.class.reconfirmable && @reconfirmation_required && !self.email.blank?
|
self.class.reconfirmable && @reconfirmation_required && self.email.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
def send_confirmation_notification?
|
def send_confirmation_notification?
|
||||||
confirmation_required? && !@skip_confirmation_notification && !self.email.blank?
|
confirmation_required? && !@skip_confirmation_notification && self.email.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
def after_confirmation
|
def after_confirmation
|
||||||
|
|
|
@ -53,7 +53,7 @@ class ConfirmationInstructionsTest < ActionMailer::TestCase
|
||||||
|
|
||||||
test 'custom mailer renders parent mailer template' do
|
test 'custom mailer renders parent mailer template' do
|
||||||
Devise.mailer = 'Users::Mailer'
|
Devise.mailer = 'Users::Mailer'
|
||||||
assert_not_blank mail.body.encoded
|
assert_present mail.body.encoded
|
||||||
end
|
end
|
||||||
|
|
||||||
test 'setup reply to as copy from sender' do
|
test 'setup reply to as copy from sender' do
|
||||||
|
|
|
@ -55,7 +55,7 @@ class ResetPasswordInstructionsTest < ActionMailer::TestCase
|
||||||
|
|
||||||
test 'custom mailer renders parent mailer template' do
|
test 'custom mailer renders parent mailer template' do
|
||||||
Devise.mailer = 'Users::Mailer'
|
Devise.mailer = 'Users::Mailer'
|
||||||
assert_not_blank mail.body.encoded
|
assert_present mail.body.encoded
|
||||||
end
|
end
|
||||||
|
|
||||||
test 'setup reply to as copy from sender' do
|
test 'setup reply to as copy from sender' do
|
||||||
|
|
|
@ -56,7 +56,7 @@ class UnlockInstructionsTest < ActionMailer::TestCase
|
||||||
|
|
||||||
test 'custom mailer renders parent mailer template' do
|
test 'custom mailer renders parent mailer template' do
|
||||||
Devise.mailer = 'Users::Mailer'
|
Devise.mailer = 'Users::Mailer'
|
||||||
assert_not_blank mail.body.encoded
|
assert_present mail.body.encoded
|
||||||
end
|
end
|
||||||
|
|
||||||
test 'setup reply to as copy from sender' do
|
test 'setup reply to as copy from sender' do
|
||||||
|
|
|
@ -9,10 +9,9 @@ class ActiveSupport::TestCase
|
||||||
assert assertion.blank?
|
assert assertion.blank?
|
||||||
end
|
end
|
||||||
|
|
||||||
def assert_not_blank(assertion)
|
def assert_present(assertion)
|
||||||
assert !assertion.blank?
|
assert assertion.present?
|
||||||
end
|
end
|
||||||
alias :assert_present :assert_not_blank
|
|
||||||
|
|
||||||
def assert_email_sent(address = nil, &block)
|
def assert_email_sent(address = nil, &block)
|
||||||
assert_difference('ActionMailer::Base.deliveries.size', &block)
|
assert_difference('ActionMailer::Base.deliveries.size', &block)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue