Sha256: 0384da40ad2e42bddb60a7e56b8f459e0014fdf19f527c5983738607de33b52a

Contents?: true

Size: 841 Bytes

Versions: 49

Compression:

Stored size: 841 Bytes

Contents

require File.join(File.dirname(__FILE__),'api_helper')

describe "RhosyncApiPing" do
  it_should_behave_like "ApiHelper"
  
  it "should do ping synchronously" do
    params = {"user_id" => @u.id, "api_token" => @api_token,
      "sources" => [@s.name], "message" => 'hello world', 
      "vibrate" => '5', "badge" => '5', "sound" => 'hello.mp3'}
    PingJob.should_receive(:perform).once.with(params)
    post "/api/ping", params
    last_response.should be_ok
  end
  
  it "should do ping asynchronously" do
    params = {"user_id" => @u.id, "api_token" => @api_token, 
      "async" => "true","sources" => [@s.name], "message" => 'hello world', 
      "vibrate" => '5', "badge" => '5', "sound" => 'hello.mp3'}
    PingJob.should_receive(:enqueue).once.with(params)
    post "/api/ping", params
    last_response.should be_ok
  end
  
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
rhosync-2.1.18.beta2 spec/api/ping_spec.rb
rhosync-2.1.18.beta1 spec/api/ping_spec.rb
rhosync-2.1.17 spec/api/ping_spec.rb
rhosync-2.1.17.beta7 spec/api/ping_spec.rb
rhosync-2.1.17.beta6 spec/api/ping_spec.rb
rhosync-2.1.17.beta5 spec/api/ping_spec.rb
rhosync-2.1.17.beta4 spec/api/ping_spec.rb
rhosync-2.1.17.beta3 spec/api/ping_spec.rb
rhosync-2.1.17.beta2 spec/api/ping_spec.rb
rhosync-2.1.17.beta1 spec/api/ping_spec.rb
rhosync-2.1.16 spec/api/ping_spec.rb
rhosync-2.1.15 spec/api/ping_spec.rb
rhosync-2.1.14 spec/api/ping_spec.rb
rhosync-2.1.13 spec/api/ping_spec.rb
rhosync-2.1.12 spec/api/ping_spec.rb
rhosync-2.1.11 spec/api/ping_spec.rb
rhosync-2.1.10 spec/api/ping_spec.rb
rhosync-2.1.7 spec/api/ping_spec.rb
rhosync-2.1.6 spec/api/ping_spec.rb
rhosync-2.1.3 spec/api/ping_spec.rb