From 0a0207ea91fdbe869ac70c23178b876bcbeb3021 Mon Sep 17 00:00:00 2001
From: Richard Macklin <richard.github@nrm.com>
Date: Fri, 27 Jan 2017 01:31:53 -0800
Subject: [PATCH] Add notified_of_own_activity to permitted attributes

in Profiles::NotificationsController#update
---
 app/controllers/profiles/notifications_controller.rb       | 2 +-
 spec/controllers/profiles/notifications_controller_spec.rb | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/app/controllers/profiles/notifications_controller.rb b/app/controllers/profiles/notifications_controller.rb
index b8b71d295f6..a271e2dfc4b 100644
--- a/app/controllers/profiles/notifications_controller.rb
+++ b/app/controllers/profiles/notifications_controller.rb
@@ -17,6 +17,6 @@ class Profiles::NotificationsController < Profiles::ApplicationController
   end
 
   def user_params
-    params.require(:user).permit(:notification_email)
+    params.require(:user).permit(:notification_email, :notified_of_own_activity)
   end
 end
diff --git a/spec/controllers/profiles/notifications_controller_spec.rb b/spec/controllers/profiles/notifications_controller_spec.rb
index 55acc445e43..54324cece6c 100644
--- a/spec/controllers/profiles/notifications_controller_spec.rb
+++ b/spec/controllers/profiles/notifications_controller_spec.rb
@@ -16,10 +16,11 @@ describe Profiles::NotificationsController do
       user = create_user
       sign_in(user)
 
-      put :update, user: { notification_email: 'new@example.com', admin: true }
+      put :update, user: { notification_email: 'new@example.com', notified_of_own_activity: true, admin: true }
 
       user.reload
       expect(user.notification_email).to eq('new@example.com')
+      expect(user.notified_of_own_activity).to eq(true)
       expect(user.admin).to eq(false)
       expect(controller).to set_flash[:notice].to('Notification settings saved')
     end
-- 
GitLab