Skip to content

Commit

Permalink
spec: fix flakey grade weight notification spec
Browse files Browse the repository at this point in the history
It appears that this problem is that more than one NotificationPolicy
was being created, however one of them is not fetchable for some reason.

Before this patchset, the issue was surfaced by the following:

    rspec './spec/models/course_spec.rb[28:3:2,28:4:1]' --seed 37829

Test plan:
- run the command above

Change-Id: I55ae0f21e22571dfd178a59a1d5a7385fa60c55b
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/233464
Tested-by: Service Cloud Jenkins <[email protected]>
Reviewed-by: James Williams <[email protected]>
QA-Review: Derek Bender <[email protected]>
Product-Review: Derek Bender <[email protected]>
  • Loading branch information
djbender committed Apr 9, 2020
1 parent cb05fb1 commit c744d48
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spec/models/course_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5233,9 +5233,10 @@ def new_external_tool(context)

describe 'grade weight notification' do
before :once do
course_with_student(:active_all => true, :active_cc => true)
course_with_student(:active_all => true)
@student.communication_channels.create!(:path => '[email protected]').confirm!
n = Notification.create!(name: 'Grade Weight Changed', category: 'TestImmediately')
NotificationPolicy.create(:notification => n, :communication_channel => @student.communication_channel, :frequency => "immediately")
NotificationPolicy.create!(:notification => n, :communication_channel => @student.communication_channel, :frequency => "immediately")
end

it "sends a notification when the course scheme changes" do
Expand Down

0 comments on commit c744d48

Please sign in to comment.