fix spec failures
This commit is contained in:
parent
ae95310523
commit
4d70c47910
|
@ -5,7 +5,7 @@ class Profiles::EmailsController < Profiles::ApplicationController
|
|||
end
|
||||
|
||||
def create
|
||||
@email = Emails::CreateService.new(current_user, current_user, email_params).execute
|
||||
@email = Emails::CreateService.new(current_user, email_params).execute
|
||||
|
||||
if @email.errors.blank?
|
||||
NotificationService.new.new_email(@email)
|
||||
|
@ -19,7 +19,7 @@ class Profiles::EmailsController < Profiles::ApplicationController
|
|||
def destroy
|
||||
@email = current_user.emails.find(params[:id])
|
||||
|
||||
Emails::DestroyService.new(current_user, current_user, email: @email.email).execute
|
||||
Emails::DestroyService.new(current_user, email: @email.email).execute
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to profile_emails_url, status: 302 }
|
||||
|
|
|
@ -494,8 +494,8 @@ class User < ActiveRecord::Base
|
|||
def update_emails_with_primary_email
|
||||
primary_email_record = emails.find_by(email: email)
|
||||
if primary_email_record
|
||||
Emails::DestroyService.new(self, self, email: email).execute
|
||||
Emails::CreateService.new(self, self, email: email_was).execute
|
||||
Emails::DestroyService.new(self, email: email).execute
|
||||
Emails::CreateService.new(self, email: email_was).execute
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue