Sha256: d1f6c5a6827d8f7aad7975640cc40fb0f079e7224527864dbb299b70c6bf34f7

Contents?: true

Size: 1.1 KB

Versions: 13

Compression:

Stored size: 1.1 KB

Contents

require "opentok/opentok"
require "opentok/version"
require "opentok/connections"
require "spec_helper"

describe OpenTok::Connections do
  before(:each) do
    now = Time.parse("2017-04-18 20:17:40 +1000")
    allow(Time).to receive(:now) { now }
  end

  let(:api_key) { "123456" }
  let(:api_secret) { "1234567890abcdef1234567890abcdef1234567890" }
  let(:session_id) { "SESSIONID" }
  let(:connection_id) { "CONNID" }
  let(:opentok) { OpenTok::OpenTok.new api_key, api_secret }
  let(:connection) { opentok.connections }

  subject { connection }


  it 'raise an error on nil session_id' do
    expect {
      connection.forceDisconnect(nil,connection_id)
    }.to raise_error(ArgumentError)
  end

  it 'raise an error on nil connection_id' do
    expect {
      connection.forceDisconnect(session_id,nil)
    }.to raise_error(ArgumentError)
  end

  it "forces a connection to be terminated", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
    response = connection.forceDisconnect(session_id, connection_id)
    expect(response).not_to be_nil
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
opentok-4.12.0 spec/opentok/connection_spec.rb
opentok-4.11.0 spec/opentok/connection_spec.rb
opentok-4.10.0 spec/opentok/connection_spec.rb
opentok-4.9.0 spec/opentok/connection_spec.rb
opentok-4.8.1 spec/opentok/connection_spec.rb
opentok-4.8.0 spec/opentok/connection_spec.rb
opentok-4.7.1 spec/opentok/connection_spec.rb
opentok-4.7.0 spec/opentok/connection_spec.rb
opentok-4.6.0 spec/opentok/connection_spec.rb
opentok-4.5.1 spec/opentok/connection_spec.rb
opentok-4.5.0 spec/opentok/connection_spec.rb
opentok-4.4.0 spec/opentok/connection_spec.rb
opentok-4.3.0 spec/opentok/connection_spec.rb