Drop CommunicationChannel::RETIRE_THRESHOLD to 1
Fixes CNVS-24308 Test plan: - Create a user - From a Rails console, run the following, where <id> is the newly created user's id: c = User.find(<id>).email_channel c.bounce_count = 1 c.save! - Log in as the user - Visit the user's settings page - Ensure that a warning triangle shows up next to the user's email address on the right side of the page Change-Id: Ibdd280ebd582c87e01f77e81917b3674810a6aba Reviewed-on: https://gerrit.instructure.com/65804 Reviewed-by: Andrew Butterfield <abutterfield@instructure.com> Tested-by: Jenkins QA-Review: Adrian Russell <arussell@instructure.com> Product-Review: Allison Weiss <allison@instructure.com>
This commit is contained in:
parent
6444a75b12
commit
c2077e75d7
|
@ -61,7 +61,7 @@ class CommunicationChannel < ActiveRecord::Base
|
|||
TYPE_PUSH = 'push'
|
||||
TYPE_YO = 'yo'
|
||||
|
||||
RETIRE_THRESHOLD = 3
|
||||
RETIRE_THRESHOLD = 1
|
||||
|
||||
# TODO: Will need to be internationalized. Also, do we want to allow this to be specified in a config file?
|
||||
def self.country_codes
|
||||
|
|
|
@ -300,12 +300,12 @@ describe NotificationMessageCreator do
|
|||
|
||||
it "should not send to bouncing channels" do
|
||||
notification_set
|
||||
@communication_channel.bounce_count = 1
|
||||
@communication_channel.bounce_count = CommunicationChannel::RETIRE_THRESHOLD - 1
|
||||
@communication_channel.save!
|
||||
messages = NotificationMessageCreator.new(@notification, @assignment, :to_list => @user).create_message
|
||||
expect(messages.select{|m| m.to == 'value for path'}.size).to eq 1
|
||||
|
||||
@communication_channel.bounce_count = 100
|
||||
@communication_channel.bounce_count = CommunicationChannel::RETIRE_THRESHOLD
|
||||
@communication_channel.save!
|
||||
messages = NotificationMessageCreator.new(@notification, @assignment, :to_list => @user).create_message
|
||||
expect(messages.select{|m| m.to == 'value for path'}.size).to eq 0
|
||||
|
|
|
@ -293,7 +293,7 @@ describe CommunicationChannel do
|
|||
@cc1 = communication_channel_model(path: 'not_as_bouncy@example.edu')
|
||||
@cc2 = communication_channel_model(path: 'bouncy@example.edu')
|
||||
|
||||
%w{bouncy@example.edu Bouncy@example.edu bOuNcY@Example.edu bouncy@example.edu not_as_bouncy@example.edu bouncy@example.edu}.each do |path|
|
||||
%w{bouncy@example.edu Bouncy@example.edu bOuNcY@Example.edu bouncy@example.edu bouncy@example.edu}.each do |path|
|
||||
CommunicationChannel.bounce_for_path(
|
||||
path: path,
|
||||
timestamp: nil,
|
||||
|
@ -304,7 +304,7 @@ describe CommunicationChannel do
|
|||
end
|
||||
|
||||
@cc1.reload
|
||||
expect(@cc1.bounce_count).to eq 1
|
||||
expect(@cc1.bounce_count).to eq 0
|
||||
expect(@cc1.bouncing?).to be_falsey
|
||||
|
||||
@cc2.reload
|
||||
|
@ -473,7 +473,7 @@ describe CommunicationChannel do
|
|||
@cc3 = communication_channel_model(path: 'BOUNCY@example.edu')
|
||||
end
|
||||
|
||||
%w{bouncy@example.edu Bouncy@example.edu bOuNcY@Example.edu bouncy@example.edu not_as_bouncy@example.edu bouncy@example.edu}.each do |path|
|
||||
%w{bouncy@example.edu Bouncy@example.edu bOuNcY@Example.edu bouncy@example.edu bouncy@example.edu}.each do |path|
|
||||
CommunicationChannel.bounce_for_path(
|
||||
path: path,
|
||||
timestamp: nil,
|
||||
|
@ -484,7 +484,7 @@ describe CommunicationChannel do
|
|||
end
|
||||
|
||||
@cc1.reload
|
||||
expect(@cc1.bounce_count).to eq 1
|
||||
expect(@cc1.bounce_count).to eq 0
|
||||
expect(@cc1.bouncing?).to be_falsey
|
||||
|
||||
@cc2.reload
|
||||
|
|
Loading…
Reference in New Issue