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.
add hidden setting to default observer notifications off
test plan: * run the following in a rails console: Account.default.tap do |a| a.settings[default_notifications_disabled_for_observers] = true a.save! end * use a sis batch import with user_observers.csv to create an observation link for a student and observer * as the observer, view the "Notifications" section of their account settings * they should all default to "Never" closes #COMMS-1898 Change-Id: Iabf5bff42efa521bdad34ccf7de277cee0e1789c Reviewed-on: https://gerrit.instructure.com/184022 Tested-by: Jenkins Reviewed-by: Landon Gilbert-Bland <[email protected]> Reviewed-by: Steven Burnett <[email protected]> QA-Review: Steven Burnett <[email protected]> Product-Review: Steven Burnett <[email protected]>
- Loading branch information
Showing
6 changed files
with
54 additions
and
7 deletions.
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
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
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 |
---|---|---|
|
@@ -196,6 +196,22 @@ def notification_set(opts = {}) | |
expect(DelayedMessage.last.send_at).to be > Time.now.utc | ||
end | ||
|
||
it "should be able to set default policies to never for a specific user" do | ||
notification_model(:category => 'TestImmediately', :name => "New notification") | ||
expect(@notification.default_frequency).to eql("immediately") | ||
|
||
u1 = user_model(:name => "user 1", :workflow_state => "registered") | ||
u1.default_notifications_disabled = true | ||
u1.save! | ||
cc = u1.communication_channels.create(:path => "[email protected]", :workflow_state => 'active') | ||
u2 = user_model(:name => "user 2", :workflow_state => "registered") | ||
cc2 = u2.communication_channels.create(:path => "[email protected]", :workflow_state => 'active') | ||
|
||
@a = assignment_model | ||
messages = NotificationMessageCreator.new(@notification, @a, :to_list => [u1, u2]).create_message | ||
expect(messages.map(&:communication_channel).compact).to eq [cc2] # doesn't include u1's cc | ||
end | ||
|
||
it "should make a delayed message for each user policy with a delayed frequency" do | ||
notification_set | ||
NotificationPolicy.delete_all | ||
|
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