Sha256: 65b819c06618d4a0aa628aa3f98781cc3ccf05603c2848ae9a63f73b2408ec45

Contents?: true

Size: 689 Bytes

Versions: 1

Compression:

Stored size: 689 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', 'data' => 'hello', 'clientId' => 'http'}
      message['signature'] = Faye::Authentication.sign(message, 'my private key')
      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

1 entries across 1 versions & 1 rubygems

Version Path
faye-authentication-0.1.0 spec/lib/faye/authentication/http_client_spec.rb