spec/single_notifier_spec.rb in notifiable-mpns-nverinaud-0.2.0 vs spec/single_notifier_spec.rb in notifiable-mpns-nverinaud-0.3.0
- old
+ new
@@ -4,12 +4,12 @@
let(:m) { Notifiable::Mpns::Nverinaud::SingleNotifier.new }
let(:d) { Notifiable::DeviceToken.create(:token => "http://db3.notify.live.net/throttledthirdparty/01.00/123456789123456798", :provider => :mpns) }
let(:u) { User.new(d) }
- it "sends an mpns notification with a title" do
- n = Notifiable::Notification.create(:payload => {:mpns => {:title => "A title"}})
+ it "sends a notification with a title" do
+ n = Notifiable::Notification.create(title: "A title")
stub_request(:post, d.token)
m.send_notification(n, d)
m.close
@@ -19,11 +19,11 @@
.with(:body => "<?xml version=\"1.0\" encoding=\"UTF-8\"?><wp:Notification xmlns:wp=\"WPNotification\"><wp:Toast><wp:Text1>A title</wp:Text1><wp:Text2></wp:Text2><wp:Param></wp:Param></wp:Toast></wp:Notification>")
.should have_been_made.once
end
it "sends a single mpns notification with content" do
- n = Notifiable::Notification.create(:message => "A message")
+ n = Notifiable::Notification.create(message: "A message")
stub_request(:post, d.token)
m.send_notification(n, d)
m.close
@@ -32,10 +32,10 @@
.with(:body => "<?xml version=\"1.0\" encoding=\"UTF-8\"?><wp:Notification xmlns:wp=\"WPNotification\"><wp:Toast><wp:Text1></wp:Text1><wp:Text2>A message</wp:Text2><wp:Param></wp:Param></wp:Toast></wp:Notification>")
.should have_been_made.once
end
it "sends custom attributes" do
- n = Notifiable::Notification.create(:payload => {:mpns => {:params => {:an_object_id => 123456}}})
+ n = Notifiable::Notification.create(:params => {:an_object_id => 123456})
stub_request(:post, d.token)
m.send_notification(n, d)
m.close
\ No newline at end of file