spec/jobs/ping_job_spec.rb in rhosync-2.0.2 vs spec/jobs/ping_job_spec.rb in rhosync-2.0.3
- old
+ new
@@ -21,6 +21,15 @@
Blackberry.should_receive(:ping).once.with({'device_pin' => @c.device_pin,
'device_port' => @c.device_port}.merge!(params))
PingJob.perform(params)
end
+ it "should skip ping for empty device_type" do
+ params = {"user_id" => @u.id, "api_token" => @api_token,
+ "sources" => [@s.name], "message" => 'hello world',
+ "vibrate" => '5', "badge" => '5', "sound" => 'hello.mp3'}
+ @c.device_type = nil
+ PingJob.should_receive(:log).once.with("Skipping ping for non-registered client_id '#{@c.id}'...")
+ lambda { PingJob.perform(params) }.should_not raise_error
+ end
+
end
\ No newline at end of file