Commit 0a0207ea authored by Richard Macklin's avatar Richard Macklin

Add notified_of_own_activity to permitted attributes

in Profiles::NotificationsController#update
parent bd03ca4a
...@@ -17,6 +17,6 @@ class Profiles::NotificationsController < Profiles::ApplicationController ...@@ -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
...@@ -16,10 +16,11 @@ describe Profiles::NotificationsController do ...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment