Sha256: f952cf5980b2049ac5d9f78c9d307dbcbcce8c72e7e96a011d4420229f4e0097

Contents?: true

Size: 1.4 KB

Versions: 18

Compression:

Stored size: 1.4 KB

Contents

require "opentok/signals"
require "opentok/opentok"
require "opentok/version"
require "spec_helper"

describe OpenTok::Signals 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(:signal) { opentok.signals }

  subject { signal }

  it 'raise an error on nil sessionId' do
    expect {
      signal.send(nil)
    }.to raise_error(ArgumentError)
  end

  it 'raise an error on empty sessionId' do
    expect {
      signal.send('')
    }.to raise_error(ArgumentError)
  end

  it "receives a valid response for all connections", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
    opts = { "type" => "chat",
             "data" => "Hello",
    }
    response = signal.send(session_id, "", opts)
    expect(response).not_to be_nil
  end

  it "receives a valid response for a connection", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
    opts = { "type" => "chat",
             "data" => "Hello",
    }
    response = signal.send(session_id, connection_id, opts)
    expect(response).not_to be_nil
  end


end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
opentok-4.10.0 spec/opentok/signal_spec.rb
opentok-4.9.0 spec/opentok/signal_spec.rb
opentok-4.8.1 spec/opentok/signal_spec.rb
opentok-4.8.0 spec/opentok/signal_spec.rb
opentok-4.7.1 spec/opentok/signal_spec.rb
opentok-4.7.0 spec/opentok/signal_spec.rb
opentok-4.6.0 spec/opentok/signal_spec.rb
opentok-4.5.1 spec/opentok/signal_spec.rb
opentok-4.5.0 spec/opentok/signal_spec.rb
opentok-4.4.0 spec/opentok/signal_spec.rb
opentok-4.3.0 spec/opentok/signal_spec.rb
opentok-4.2.0 spec/opentok/signal_spec.rb
opentok-4.1.2 spec/opentok/signal_spec.rb
opentok-4.1.1 spec/opentok/signal_spec.rb
opentok-4.1.0 spec/opentok/signal_spec.rb
opentok-4.0.1 spec/opentok/signal_spec.rb
opentok-4.0.0 spec/opentok/signal_spec.rb
opentok-3.1.0 spec/opentok/signal_spec.rb