Sha256: 921f67657359e838e1e6898cef5ba48bbdb5f7b5c5cbf1b951caf4b517d5c92c

Contents?: true

Size: 1003 Bytes

Versions: 15

Compression:

Stored size: 1003 Bytes

Contents

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

describe "RhoconnectApiPing" do
  include_examples "ApiHelper"

  it "should do ping synchronously" do
    params = {"user_id" => @u.id, "sources" => [@s.name], "message" => 'hello world',
      "vibrate" => '5', "badge" => '5', "sound" => 'hello.mp3'}
    PingJob.should respond_to :perform
    PingJob.should_receive(:perform).once.with(params)
    post "/rc/#{Rhoconnect::API_VERSION}/users/ping", params, {Rhoconnect::API_TOKEN_HEADER => @api_token}
    last_response.should be_ok
  end

  it "should do ping asynchronously" do
    params = {"user_id" => @u.id, "async" => "true","sources" => [@s.name], "message" => 'hello world',
      "vibrate" => '5', "badge" => '5', "sound" => 'hello.mp3'}

    PingJob.should respond_to :enqueue
    PingJob.should_receive(:enqueue).once.with(params)
    post "/rc/#{Rhoconnect::API_VERSION}/users/ping", params, {Rhoconnect::API_TOKEN_HEADER => @api_token}
    last_response.should be_ok
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
rhoconnect-7.6.0 spec/api/user/ping_spec.rb
rhoconnect-7.5.1 spec/api/user/ping_spec.rb
rhoconnect-7.4.1 spec/api/user/ping_spec.rb
rhoconnect-7.1.17 spec/api/user/ping_spec.rb
rhoconnect-6.2.0 spec/api/user/ping_spec.rb
rhoconnect-6.0.11 spec/api/user/ping_spec.rb
rhoconnect-5.5.18 spec/api/user/ping_spec.rb
rhoconnect-5.5.17 spec/api/user/ping_spec.rb
rhoconnect-5.5.15 spec/api/user/ping_spec.rb
rhoconnect-5.5.0.22 spec/api/user/ping_spec.rb
rhoconnect-5.5.2 spec/api/user/ping_spec.rb
rhoconnect-5.5.0.7 spec/api/user/ping_spec.rb
rhoconnect-5.5.0.3 spec/api/user/ping_spec.rb
rhoconnect-5.5.0 spec/api/user/ping_spec.rb
rhoconnect-5.1.1 spec/api/user/ping_spec.rb