Commit e2e0b175 authored by James Lopez's avatar James Lopez

fix specs

parent 12dc3992
...@@ -156,11 +156,11 @@ class Admin::UsersController < Admin::ApplicationController ...@@ -156,11 +156,11 @@ class Admin::UsersController < Admin::ApplicationController
respond_to do |format| respond_to do |format|
if success if success
format.html { redirect_back_or_admin_user(notice: "Successfully removed email.") } format.html { redirect_back_or_admin_user(notice: 'Successfully removed email.') }
format.json { head :ok } format.json { head :ok }
else else
format.html { redirect_back_or_admin_user(alert: result[:message]) } format.html { redirect_back_or_admin_user(alert: 'There was an error removing the e-mail.') }
format.json { render json: result[:message], status: result[:status] } format.json { render json: 'There was an error removing the e-mail.', status: 400 }
end end
end end
end end
......
...@@ -10,7 +10,7 @@ module Users ...@@ -10,7 +10,7 @@ module Users
def execute(skip_authorization: false, validate: true, &block) def execute(skip_authorization: false, validate: true, &block)
assign_attributes(skip_authorization, &block) assign_attributes(skip_authorization, &block)
if @user.save(validate: validate) || @user.errors.empty? if @user.save(validate: validate)
success success
else else
error(@user.errors.full_messages.uniq.join('. ')) error(@user.errors.full_messages.uniq.join('. '))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment