Skip to content

Commit

Permalink
[issue-4351] edit test case to reflect old mail sent
Browse files Browse the repository at this point in the history
  • Loading branch information
Tooyosi committed Aug 16, 2024
1 parent aae5b02 commit d015acf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions app/controllers/api/v1/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def update
user.update(valid_email: true)
UserInfoChangedMailerWorker.perform_async(user.id, 'email', prev_email)
end

end

def destroy
Expand Down Expand Up @@ -120,4 +119,4 @@ def filter_by_params
def downcase_filter_params(param_value)
param_value.split(',').map(&:downcase)
end
end
end
2 changes: 1 addition & 1 deletion app/mailers/user_info_changed_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ def user_info_changed(user, info, previous_email=nil)
template = "password_changed"
end

mail(to: @recipient_emails, subject: subject, template_name: template )
mail(to: @recipient_emails, subject: subject, template_name: template)
end
end
2 changes: 1 addition & 1 deletion spec/controllers/api/v1/users_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ def update_request
update_request
end

it "sends an email to the new address if user is valid" do
it "sends an email to the new and old address if user is valid" do
expect(UserInfoChangedMailerWorker).to receive(:perform_async).with(user.id, "email", user_email)
end

Expand Down

0 comments on commit d015acf

Please sign in to comment.