Sha256: bc75f3fe3cb2ac4dd6cc31ebfd449573d57897409e2ee26735e69bced6cfe4e7

Contents?: true

Size: 1.03 KB

Versions: 14

Compression:

Stored size: 1.03 KB

Contents

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

describe "RhoconnectApiPing" do
  it_should_behave_like "ApiHelper" do
    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  
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rhoconnect-4.0.4 spec/api/user/ping_spec.rb
rhoconnect-4.0.3 spec/api/user/ping_spec.rb
rhoconnect-4.0.2 spec/api/user/ping_spec.rb
rhoconnect-4.0.1 spec/api/user/ping_spec.rb
rhoconnect-4.0.0 spec/api/user/ping_spec.rb
rhoconnect-4.0.0.beta.24 spec/api/user/ping_spec.rb
rhoconnect-3.4.5 spec/api/user/ping_spec.rb
rhoconnect-4.0.0.beta.10 spec/api/user/ping_spec.rb
rhoconnect-4.0.0.beta.12 spec/api/user/ping_spec.rb
rhoconnect-3.4.4 spec/api/user/ping_spec.rb
rhoconnect-3.4.3 spec/api/user/ping_spec.rb
rhoconnect-3.4.2 spec/api/user/ping_spec.rb
rhoconnect-3.3.6 spec/api/user/ping_spec.rb
rhoconnect-3.3.5 spec/api/user/ping_spec.rb