diff --git a/app/models/enterprise_role.rb b/app/models/enterprise_role.rb index 1cb23ba738..c283a12b1d 100644 --- a/app/models/enterprise_role.rb +++ b/app/models/enterprise_role.rb @@ -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 diff --git a/spec/controllers/user_registrations_controller_spec.rb b/spec/controllers/user_registrations_controller_spec.rb index c2239623b5..578ff27214 100644 --- a/spec/controllers/user_registrations_controller_spec.rb +++ b/spec/controllers/user_registrations_controller_spec.rb @@ -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