Code review refactoring

This commit is contained in:
Matt-Yorkley
2017-10-06 12:11:22 +01:00
committed by Rob Harrington
parent fde0aba96c
commit 525cb4826f
2 changed files with 2 additions and 1 deletions

View File

@@ -17,7 +17,7 @@ class EnterpriseRole < ActiveRecord::Base
managers_for(enterprise_id).map do |m|
if m.user_id == user_id.to_i
m.update_attributes receives_notifications: true
elsif m.user_id != user_id.to_i && m.receives_notifications
elsif m.receives_notifications
m.update_attributes receives_notifications: false
end
end

View File

@@ -21,6 +21,7 @@ describe UserRegistrationsController, type: :controller do
response.status.should == 200
json = JSON.parse(response.body)
json.should == {"email" => "test@test.com"}
expect(controller.spree_current_user).to be_nil
end
end