Sha256: 849eee1987cc7fcf934a1f849e1f465f2bc77eb64ffc24a040bed9446477405c

Contents?: true

Size: 1013 Bytes

Versions: 56

Compression:

Stored size: 1013 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

# Option token has disabled do response is automatically an error
describe 'RubyRabbitmqJanus::RRJAdmin -- add_token', type: :request,
                                                     level: :admin,
                                                     name: :add_token do
  before do
    help_admin_prepare
    help_admin_request_tested(parameter)
  end

  let(:type) { 'admin::add_token' }

  context 'when no configured in Janus' do
    let(:instance) { { 'instance' => RubyRabbitmqJanus::Models::JanusInstance.find('1').id.to_s } }
    let(:parameter) { {} }

    it { expect(@transaction.to_json).to match_json_schema('base::error') }
  end

  context 'when configured in janus' do
    let(:instance) { { 'instance' => RubyRabbitmqJanus::Models::JanusInstance.find('2').id.to_s } }
    let(:parameter) { { 'token' => [*('a'..'z'), *('0'..'9')].sample(24).join } }

    it { expect(@transaction.to_json).to match_json_schema('base::error') }
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
ruby_rabbitmq_janus-3.0.0.pre.336 spec/request/admin/request_add_token_spec.rb
ruby_rabbitmq_janus-3.0.0.pre.335 spec/request/admin/request_add_token_spec.rb
ruby_rabbitmq_janus-3.0.0.pre.334 spec/request/admin/request_add_token_spec.rb
ruby_rabbitmq_janus-3.0.0.pre.330 spec/request/admin/request_add_token_spec.rb
ruby_rabbitmq_janus-3.0.0.pre.328 spec/request/admin/request_add_token_spec.rb
ruby_rabbitmq_janus-3.0.0.pre.327 spec/request/admin/request_add_token_spec.rb
ruby_rabbitmq_janus-2.7.2 spec/request/admin/request_add_token_spec.rb
ruby_rabbitmq_janus-2.7.2.pre.322 spec/request/admin/request_add_token_spec.rb
ruby_rabbitmq_janus-2.7.2.pre.320 spec/request/admin/request_add_token_spec.rb
ruby_rabbitmq_janus-2.7.2.pre.319 spec/request/admin/request_add_token_spec.rb
ruby_rabbitmq_janus-2.7.2.pre.318 spec/request/admin/request_add_token_spec.rb
ruby_rabbitmq_janus-2.7.2.pre.317 spec/request/admin/request_add_token_spec.rb
ruby_rabbitmq_janus-2.7.2.pre.316 spec/request/admin/request_add_token_spec.rb
ruby_rabbitmq_janus-2.7.2.pre.315 spec/request/admin/request_add_token_spec.rb
ruby_rabbitmq_janus-2.7.2.pre.314 spec/request/admin/request_add_token_spec.rb
ruby_rabbitmq_janus-2.7.2.pre.312 spec/request/admin/request_add_token_spec.rb
ruby_rabbitmq_janus-2.7.2.pre.310 spec/request/admin/request_add_token_spec.rb
ruby_rabbitmq_janus-2.7.2.pre.309 spec/request/admin/request_add_token_spec.rb
ruby_rabbitmq_janus-2.7.2.pre.308 spec/request/admin/request_add_token_spec.rb
ruby_rabbitmq_janus-2.7.2.pre.307 spec/request/admin/request_add_token_spec.rb