Sha256: ad63d4cf8c24beaa9f1c7df032a41042d6eebc81ccb28248cbe5c7f32f6637bd

Contents?: true

Size: 1.93 KB

Versions: 31

Compression:

Stored size: 1.93 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

describe RubyRabbitmqJanus::Tools::Replaces::Session, type: :tools,
                                                      name: :replace do
  subject(:replace) do
    # Get request JSON file
    rqe = RubyRabbitmqJanus::Tools::Requests.instance.requests['test::replace']
    # Open request file
    described_class.new(JSON.parse(File.read(rqe)), options)
  end

  context 'when replace classic element' do
    let(:opt_session) { Random.rand(123_456_789..987_654_321) }
    let(:opt_plugin) { 'janus.plugin.echotest' }
    let(:options) do
      {
        'session_id' => opt_session,
        'plugin' => opt_plugin,
        'replace' => {}, 'add' => {}
      }
    end

    context 'with transform request' do
      it { expect(replace.transform_request).to be_kind_of(Hash) }
    end

    context 'with transform request session_id' do
      include_examples 'test replace in request', 'session_id', Integer
    end

    context 'with transform request transaction' do
      include_examples 'test replace in request nil', 'transaction'
    end

    context 'with transform request handle_id' do
      include_examples 'test replace in request nil', 'handle_id'
    end

    context 'with transform request plugin' do
      include_examples 'test replace in request', 'plugin', String
    end

    context 'with transform request candidates' do
      include_examples 'test replace in request nil', 'candidates'
    end

    context 'with transform request audio' do
      include_examples 'test replace in request nil', 'audio'
    end

    context 'with transform request sdp' do
      let(:key) { 'jsep' }

      include_examples 'test replace in request nil', 'sdp'
    end

    context 'with transform request debug' do
      include_examples 'test replace in request nil', 'debug'
    end

    context 'with transform request level' do
      include_examples 'test replace in request nil', 'level'
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
ruby_rabbitmq_janus-4.0.1 spec/ruby_rabbitmq_janus/tools/replaces/session_spec.rb
ruby_rabbitmq_janus-4.0.1.pre.1265973744 spec/ruby_rabbitmq_janus/tools/replaces/session_spec.rb
ruby_rabbitmq_janus-4.0.1.pre.1265506307 spec/ruby_rabbitmq_janus/tools/replaces/session_spec.rb
ruby_rabbitmq_janus-4.0.1.pre.1265140558 spec/ruby_rabbitmq_janus/tools/replaces/session_spec.rb
ruby_rabbitmq_janus-4.0.0 spec/ruby_rabbitmq_janus/tools/replaces/session_spec.rb
ruby_rabbitmq_janus-4.0.0.pre.1001345090 spec/ruby_rabbitmq_janus/tools/replaces/session_spec.rb
ruby_rabbitmq_janus-4.0.0.pre.1001181479 spec/ruby_rabbitmq_janus/tools/replaces/session_spec.rb
ruby_rabbitmq_janus-4.0.0.pre.1001132533 spec/ruby_rabbitmq_janus/tools/replaces/session_spec.rb
ruby_rabbitmq_janus-4.0.0.pre.1001107243 spec/ruby_rabbitmq_janus/tools/replaces/session_spec.rb
ruby_rabbitmq_janus-4.0.0.pre.1001043172 spec/ruby_rabbitmq_janus/tools/replaces/session_spec.rb
ruby_rabbitmq_janus-4.0.0.pre.949167646 spec/ruby_rabbitmq_janus/tools/replaces/session_spec.rb
ruby_rabbitmq_janus-4.0.0.pre.946892338 spec/ruby_rabbitmq_janus/tools/replaces/session_spec.rb
ruby_rabbitmq_janus-4.0.0.pre.946565704 spec/ruby_rabbitmq_janus/tools/replaces/session_spec.rb
ruby_rabbitmq_janus-4.0.0.pre.939149205 spec/ruby_rabbitmq_janus/tools/replaces/session_spec.rb
ruby_rabbitmq_janus-4.0.0.pre.939137013 spec/ruby_rabbitmq_janus/tools/replaces/session_spec.rb
ruby_rabbitmq_janus-4.0.0.pre.939133437 spec/ruby_rabbitmq_janus/tools/replaces/session_spec.rb
ruby_rabbitmq_janus-4.0.0.pre.939119110 spec/ruby_rabbitmq_janus/tools/replaces/session_spec.rb
ruby_rabbitmq_janus-4.0.0.pre.939113634 spec/ruby_rabbitmq_janus/tools/replaces/session_spec.rb
ruby_rabbitmq_janus-4.0.0.pre.850041590 spec/ruby_rabbitmq_janus/tools/replaces/session_spec.rb
ruby_rabbitmq_janus-3.0.1 spec/ruby_rabbitmq_janus/tools/replaces/session_spec.rb