Sha256: 3cbe473ccff6b1606e5beed6af08f7b47ab0d8752798e4da392c5fa716e9ea14

Contents?: true

Size: 702 Bytes

Versions: 12

Compression:

Stored size: 702 Bytes

Contents

require 'spec_helper'
require 'faye/authentication'

describe Faye::Authentication::HTTPClient do

  describe '.publish' do

    it 'should publish a HTTP request with correct params' do
      message = {'channel' => '/foo/bar', 'clientId' => 'http'}
      message['signature'] = Faye::Authentication.sign(message, 'my private key')
      message['data'] = 'hello'
      request = stub_request(:post, "http://www.example.com").with(:body => {:message => JSON.dump(message)}).to_return(:status => 200, :body => "", :headers => {})
      Faye::Authentication::HTTPClient.publish('http://www.example.com', '/foo/bar', "hello", 'my private key')
      expect(request).to have_been_made
    end

  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
faye-authentication-1.10.0 spec/lib/faye/authentication/http_client_spec.rb
faye-authentication-1.9.1 spec/lib/faye/authentication/http_client_spec.rb
faye-authentication-1.9.0 spec/lib/faye/authentication/http_client_spec.rb
faye-authentication-1.8.2 spec/lib/faye/authentication/http_client_spec.rb
faye-authentication-1.8.1 spec/lib/faye/authentication/http_client_spec.rb
faye-authentication-1.8.0 spec/lib/faye/authentication/http_client_spec.rb
faye-authentication-1.7.0 spec/lib/faye/authentication/http_client_spec.rb
faye-authentication-1.6.1 spec/lib/faye/authentication/http_client_spec.rb
faye-authentication-1.6.0 spec/lib/faye/authentication/http_client_spec.rb
faye-authentication-0.4.0 spec/lib/faye/authentication/http_client_spec.rb
faye-authentication-0.3.0 spec/lib/faye/authentication/http_client_spec.rb
faye-authentication-0.2.0 spec/lib/faye/authentication/http_client_spec.rb