[Git][noosfero/noosfero][master] 2 commits: Refactors webpush unit test

Gabriel Silva gitlab at mg.gitlab.com
Thu Feb 1 12:28:27 BRST 2018


Gabriel Silva pushed to branch master at Noosfero / noosfero


Commits:
4a66f737 by Gabriel Silva at 2018-02-01T12:02:20-02:00
Refactors webpush unit test

Signed-off-by: Gabriel Silva <gabriel93.silva at gmail.com>

- - - - -
a12c77e2 by Gabriel Silva at 2018-02-01T14:28:16+00:00
Merge branch 'webpush_test' into 'master'

Refactors WebPush unit test

See merge request noosfero/noosfero!1393
- - - - -


1 changed file:

- test/unit/web_push_test.rb


Changes:

=====================================
test/unit/web_push_test.rb
=====================================
--- a/test/unit/web_push_test.rb
+++ b/test/unit/web_push_test.rb
@@ -18,4 +18,15 @@ class WebPushTest < ActiveSupport::TestCase
     WebPush.notify(subscription, {})
   end
 
+  should 'destroy the subscription when it raises InvalidSubscription' do
+    subscription = mock
+    subscription.stubs(:endpoint)
+    subscription.stubs(:keys).returns({})
+    subscription.stubs(:subject)
+
+    subscription.expects(:destroy).once
+    Webpush.expects(:payload_send).raises(Webpush::InvalidSubscription)
+    WebPush.notify(subscription, {})
+  end
+
 end



View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/3f0f20aa6d32b9490ae05375d048049aab474064...a12c77e21144c52736d62ac9008b210ea2519b2b

---
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/3f0f20aa6d32b9490ae05375d048049aab474064...a12c77e21144c52736d62ac9008b210ea2519b2b
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20180201/c939934e/attachment.html>


More information about the Noosfero-dev mailing list