Add mod_roundrobin_notifications to user_policy.rb (#4226) [ci skip]

This commit is contained in:
Akshay Mahajan 2019-10-08 23:22:20 +05:30 committed by Mac Siri
parent bec5b79120
commit 1cf125cb4f
2 changed files with 11 additions and 0 deletions

View file

@ -99,6 +99,7 @@ class UserPolicy < ApplicationPolicy
mastodon_url
medium_url
mobile_comment_notifications
mod_roundrobin_notifications
mostly_work_with
name
password

View file

@ -53,6 +53,16 @@ RSpec.describe "UserSettings", type: :request do
expect(user.reload.profile_updated_at).to be > 2.minutes.ago
end
it "enables community-success notifications" do
put "/users/#{user.id}", params: { user: { tab: "notifications", mod_roundrobin_notifications: 1 } }
expect(user.reload.mod_roundrobin_notifications).to be(true)
end
it "disables community-success notifications" do
put "/users/#{user.id}", params: { user: { tab: "notifications", mod_roundrobin_notifications: 0 } }
expect(user.reload.mod_roundrobin_notifications).to be(false)
end
it "updates username to too short username" do
put "/users/#{user.id}", params: { user: { tab: "profile", username: "h" } }
expect(response.body).to include("Username is too short")