don't suppress notifications for recently created wiki pages

test plan:
* create a course with a student
* as the student, set "Course Content" notification settings
 to ASAP
* create a wiki page and publish it
* wait one minute
* edit the wiki page and check the "Notify users that
 this content has changed"
* it should send out a notification

closes #CNVS-16153

Change-Id: I4ed21717ca38f11ba44225ce886b32f47417acde
Reviewed-on: https://gerrit.instructure.com/75057
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
This commit is contained in:
James Williams 2016-03-22 09:37:14 -06:00
parent 64d58310c1
commit f613d384d7
2 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@ module BroadcastPolicies
return false if wiki_page.wiki.context.concluded? return false if wiki_page.wiki.context.concluded?
return false if wiki_page.wiki.context.respond_to?(:unpublished?) && wiki_page.wiki.context.unpublished? return false if wiki_page.wiki.context.respond_to?(:unpublished?) && wiki_page.wiki.context.unpublished?
end end
return false unless created_before?(30.minutes.ago) return false unless created_before?(1.minutes.ago)
changed_while_published? || wiki_page.changed_state(:active) changed_while_published? || wiki_page.changed_state(:active)
end end

View File

@ -47,7 +47,7 @@ module BroadcastPolicies
expect(policy.should_dispatch_updated_wiki_page?).to be_falsey expect(policy.should_dispatch_updated_wiki_page?).to be_falsey
end end
specify { wont_send_when { wiki_page.stubs(:created_at).returns 1.minute.ago } } specify { wont_send_when { wiki_page.stubs(:created_at).returns 30.seconds.ago } }
specify { wont_send_when { wiki_page.stubs(:published?).returns false } } specify { wont_send_when { wiki_page.stubs(:published?).returns false } }
specify { wont_send_when { wiki_page.stubs(:wiki_page_changed).returns false } } specify { wont_send_when { wiki_page.stubs(:wiki_page_changed).returns false } }
specify { wont_send_when { wiki_page.stubs(:prior_version).returns nil } } specify { wont_send_when { wiki_page.stubs(:prior_version).returns nil } }