Sha256: bd8fb30964924a4e85cf3d79ee754c166655f1d14dd4a102e6a65f786a43b58e

Contents?: true

Size: 849 Bytes

Versions: 8

Compression:

Stored size: 849 Bytes

Contents

require 'spec_helper'

RSpec.describe 'Client draft 11 handshake' do
  let(:handshake) { WebSocket::Handshake::Client.new({ uri: 'ws://example.com/demo', origin: 'http://example.com', version: version }.merge(@request_params || {})) }

  let(:version) { 11 }
  let(:client_request) { client_handshake_11({ key: handshake.handler.send(:key), version: version }.merge(@request_params || {})) }
  let(:server_response) { server_handshake_11({ accept: handshake.handler.send(:accept) }.merge(@request_params || {})) }

  it_should_behave_like 'all client drafts'

  it 'should disallow client with invalid challenge' do
    @request_params = { accept: 'invalid' }
    handshake << server_response

    expect(handshake).to be_finished
    expect(handshake).not_to be_valid
    expect(handshake.error).to eql(:invalid_handshake_authentication)
  end
end

Version data entries

8 entries across 7 versions & 2 rubygems

Version Path
tdiary-5.0.5 vendor/bundle/gems/websocket-1.2.4/spec/handshake/client_11_spec.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/websocket-1.2.4/spec/handshake/client_11_spec.rb
tdiary-5.0.4 vendor/bundle/gems/websocket-1.2.4/spec/handshake/client_11_spec.rb
websocket-1.2.4 spec/handshake/client_11_spec.rb
tdiary-5.0.2 vendor/bundle/gems/websocket-1.2.3/spec/handshake/client_11_spec.rb
tdiary-5.0.1 vendor/bundle/gems/websocket-1.2.3/spec/handshake/client_11_spec.rb
websocket-1.2.3 spec/handshake/client_11_spec.rb
websocket-1.2.2 spec/handshake/client_11_spec.rb