forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
don't error on the comm prefs page; refs #6914
When a user's immediate messages start getting throttled (like when they've received 50 in a day), we create a NotificationPolicy for that user with no Notification. That's not an ideal design, but rather than fix that now, we're just going to make sure those policies don't cause errors test plan: * See specs. Change-Id: Ib262b256a9d4fe5fe7fd882d6848883e7a40cb59 Reviewed-on: https://gerrit.instructure.com/8096 Reviewed-by: Cody Cutrer <[email protected]> Tested-by: Hudson <[email protected]>
- Loading branch information
1 parent
d3e6c6b
commit 867c8db
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,4 +48,20 @@ | |
@cc.reload.position.should == 2 | ||
end | ||
end | ||
|
||
describe "GET 'communication'" do | ||
it "should not fail when a user has a notification policy with no notification" do | ||
# A user might have a NotificationPolicy with no Notification if the policy was created | ||
# as part of throttling a user's "immediate" messages. Eventually we should fix how that | ||
# works, but for now we just make sure that that state does not cause an error for the | ||
# user when they go to their notification preferences. | ||
user_model | ||
user_session(@user) | ||
cc = @user.communication_channels.create!(:path => '[email protected]', :path_type => 'email') { |cc| cc.workflow_state = 'active' } | ||
@user.notification_policies.create!(:notification => nil, :communication_channel => cc, :frequency => 'daily') | ||
|
||
get 'communication' | ||
response.should be_success | ||
end | ||
end | ||
end |