mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-03 06:59:14 +00:00
Code review refactoring
This commit is contained in:
committed by
Rob Harrington
parent
fde0aba96c
commit
525cb4826f
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user