Sha256: 711c16e7db9d4f26cdd823e148ac21adc9c313f231b5cc1ae7f3aa4b35a0dcf5

Contents?: true

Size: 1003 Bytes

Versions: 46

Compression:

Stored size: 1003 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe RubyRabbitmqJanus::Models::JanusInstance, type: :model,
                                                   name: :janus_instance do
  let(:model) { described_class }
  let(:parameter_mongo) do
    {
      'id' => '_id',
      'session_id' => 'session',
      'instance' => '_id',
      'title' => 'name'
    }
  end
  let(:parameter_sqlite) do
    {
      'instance' => 'id',
      'session_id' => 'session',
      'title' => 'name'
    }
  end

  context 'when Janus Instance model definition' do
    if ENV['MONGO'].match?('true')
      it { expect(model.attribute_names).to include('_id') }
      it { expect(model.aliased_fields).to eq(parameter_mongo) }
    else
      it { expect(model.attribute_names).to include('id') }
      it { expect(model.attribute_aliases).to eq(parameter_sqlite) }
    end
    it { expect(model.attribute_names).to include('session') }
    it { expect(model.attribute_names).to include('enable') }
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

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