notify_user 0.0.20 → 0.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -111,15 +111,15 @@ module NotifyUser
111
111
 
112
112
  NewPostNotification.create({target: user})
113
113
 
114
- NotificationMailer.should_receive(:aggregate_notifications_email).with(BaseNotification.pending_aggregation_with(notification), anything).and_call_original
115
- BaseNotification.notify_aggregated(notification.id)
114
+ NotificationMailer.should_receive(:aggregate_notifications_email).with(NewPostNotification.pending_aggregation_with(notification), anything).and_call_original
115
+ NewPostNotification.notify_aggregated(notification.id)
116
116
  end
117
117
 
118
118
  it "sends a singular email if no more notifications were queued since the original was delayed" do
119
119
  Sidekiq::Testing.inline!
120
120
  Apns.should_receive(:push_notification).at_least(1).times
121
121
  NotificationMailer.should_receive(:notification_email).with(notification, anything).and_call_original
122
- BaseNotification.notify_aggregated(notification.id)
122
+ NewPostNotification.notify_aggregated(notification.id)
123
123
  end
124
124
 
125
125
  end
@@ -146,15 +146,15 @@ module NotifyUser
146
146
 
147
147
  NewPostNotification.create({target: user, type: 'NewPostNotification'})
148
148
 
149
- BaseNotification.should_receive(:deliver_notifications_channel).and_call_original
150
- BaseNotification.notify_aggregated_channel(notification.id, 'action_mailer')
149
+ NewPostNotification.should_receive(:deliver_notifications_channel).and_call_original
150
+ NewPostNotification.notify_aggregated_channel(notification.id, 'action_mailer')
151
151
  end
152
152
 
153
153
  it "sends a single email if more not pending notifications" do
154
154
  Sidekiq::Testing.inline!
155
155
 
156
- BaseNotification.should_receive(:deliver_notification_channel).and_call_original
157
- BaseNotification.notify_aggregated_channel(notification.id, 'action_mailer')
156
+ NewPostNotification.should_receive(:deliver_notification_channel).and_call_original
157
+ NewPostNotification.notify_aggregated_channel(notification.id, 'action_mailer')
158
158
  end
159
159
  end
160
160
 
@@ -185,6 +185,7 @@ module NotifyUser
185
185
 
186
186
  it "doesn't send if unsubscribed from mailer channel" do
187
187
  unsubscribe = NotifyUser::Unsubscribe.create({target: user, type: "action_mailer"})
188
+ unsubscribe.save!
188
189
  ActionMailerChannel.should_not_receive(:deliver)
189
190
 
190
191
  ApnsChannel.should_receive(:deliver)
@@ -23,11 +23,6 @@ module NotifyUser
23
23
  notification.notify
24
24
  end
25
25
 
26
- it "doesnt create object if notification type isn't unsubscribable" do
27
- unsubscribe = NotifyUser::Unsubscribe.create({target: user, type: "UnsubscribableNotification"})
28
- NotifyUser::Unsubscribe.last.type.should_not eq "UnsubscribableNotification"
29
- end
30
-
31
26
  it "toggles the status of a subscription" do
32
27
  unsubscribe = NotifyUser::Unsubscribe.create({target: user, type: "NewPostNotification"})
33
28
  NotifyUser::Unsubscribe.toggle_status(user, "NewPostNotification")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notify_user
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Spacek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-09 00:00:00.000000000 Z
11
+ date: 2014-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails