Skip to content
Snippets Groups Projects
Commit 0a0207ea authored by Richard Macklin's avatar Richard Macklin
Browse files

Add notified_of_own_activity to permitted attributes

in Profiles::NotificationsController#update
parent bd03ca4a
No related branches found
No related tags found
1 merge request!8836Add option to receive email notifications about your own activity
Loading
@@ -17,6 +17,6 @@ class Profiles::NotificationsController < Profiles::ApplicationController
Loading
@@ -17,6 +17,6 @@ class Profiles::NotificationsController < Profiles::ApplicationController
end end
   
def user_params def user_params
params.require(:user).permit(:notification_email) params.require(:user).permit(:notification_email, :notified_of_own_activity)
end end
end end
Loading
@@ -16,10 +16,11 @@ describe Profiles::NotificationsController do
Loading
@@ -16,10 +16,11 @@ describe Profiles::NotificationsController do
user = create_user user = create_user
sign_in(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 user.reload
expect(user.notification_email).to eq('new@example.com') 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(user.admin).to eq(false)
expect(controller).to set_flash[:notice].to('Notification settings saved') expect(controller).to set_flash[:notice].to('Notification settings saved')
end end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment