Skip to content

Commit

Permalink
Profile update test should set email value to nil when not specified.…
Browse files Browse the repository at this point in the history
… Change && to || operators when determining if a confirmation email should be sent
  • Loading branch information
Jordan Byron committed Jan 14, 2012
1 parent 24edb1c commit d91481d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def update
response = @user.edit_user_profile(params)
if response == true

unless @user.email.blank? && @user.email_confirmed
unless @user.email.blank? || @user.email_confirmed
# Generate same token as password reset....
Notifier.send_confirm_email_notification(@user.email, @user.set_perishable_token)
flash[:notice] = "A link to confirm your updated email address has been sent to #{@user.email}."
Expand Down
2 changes: 1 addition & 1 deletion test/acceptance/profile_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
end

it "does not verify your email if you havent specified one" do
user_without_email = Factory(:user, :email => "", :username => "no_email")
user_without_email = Factory(:user, :email => nil, :username => "no_email")
a = Factory(:authorization, :user => user_without_email)

log_in(user_without_email, a.uid)
Expand Down

0 comments on commit d91481d

Please sign in to comment.