1
0
Fork 0
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:
Michael Crismali 2014-04-17 20:28:17 -05:00
parent 081ea9e0ba
commit f37b10ef87
5 changed files with 8 additions and 9 deletions

View file

@ -236,17 +236,17 @@ module Devise
end
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
postpone
end
def reconfirmation_required?
self.class.reconfirmable && @reconfirmation_required && !self.email.blank?
self.class.reconfirmable && @reconfirmation_required && self.email.present?
end
def send_confirmation_notification?
confirmation_required? && !@skip_confirmation_notification && !self.email.blank?
confirmation_required? && !@skip_confirmation_notification && self.email.present?
end
def after_confirmation

View file

@ -53,7 +53,7 @@ class ConfirmationInstructionsTest < ActionMailer::TestCase
test 'custom mailer renders parent mailer template' do
Devise.mailer = 'Users::Mailer'
assert_not_blank mail.body.encoded
assert_present mail.body.encoded
end
test 'setup reply to as copy from sender' do

View file

@ -55,7 +55,7 @@ class ResetPasswordInstructionsTest < ActionMailer::TestCase
test 'custom mailer renders parent mailer template' do
Devise.mailer = 'Users::Mailer'
assert_not_blank mail.body.encoded
assert_present mail.body.encoded
end
test 'setup reply to as copy from sender' do

View file

@ -56,7 +56,7 @@ class UnlockInstructionsTest < ActionMailer::TestCase
test 'custom mailer renders parent mailer template' do
Devise.mailer = 'Users::Mailer'
assert_not_blank mail.body.encoded
assert_present mail.body.encoded
end
test 'setup reply to as copy from sender' do

View file

@ -9,10 +9,9 @@ class ActiveSupport::TestCase
assert assertion.blank?
end
def assert_not_blank(assertion)
assert !assertion.blank?
def assert_present(assertion)
assert assertion.present?
end
alias :assert_present :assert_not_blank
def assert_email_sent(address = nil, &block)
assert_difference('ActionMailer::Base.deliveries.size', &block)