Sha256: 53fc620571ad5afe316d2fed3bf7b1ce6517c779c4f84c392338ab79267a2b93

Contents?: true

Size: 1.64 KB

Versions: 16

Compression:

Stored size: 1.64 KB

Contents

require 'spec_helper'

describe Maestrano::Connector::Rails::SubEntityBase do
  subject { Maestrano::Connector::Rails::SubEntityBase.new }

  describe 'external?' do
    it { expect{ subject.external? }.to raise_error('Not implemented') }
  end

  describe 'entity_name' do
    it { expect{ subject.entity_name }.to raise_error('Not implemented') }
  end

  describe 'map_to' do
    it { expect{ subject.map_to('name', {}, nil) }.to raise_error('Not implemented') }
  end

  describe 'external_entity_name' do
    context 'when entity is external' do
      before(:each) {
        allow_any_instance_of(Maestrano::Connector::Rails::SubEntityBase).to receive(:external?).and_return(true)
        allow_any_instance_of(Maestrano::Connector::Rails::SubEntityBase).to receive(:entity_name).and_return('Name')
      }

      it 'returns the entity_name' do
        expect(subject.external_entity_name).to eql('Name')
      end
    end

    context 'when entity is not external' do
      it { expect{ subject.external_entity_name }.to raise_error('Not implemented') }
    end
  end

  describe 'connec_entity_name' do
    context 'when entity is not external' do
      before(:each) {
        allow_any_instance_of(Maestrano::Connector::Rails::SubEntityBase).to receive(:external?).and_return(false)
        allow_any_instance_of(Maestrano::Connector::Rails::SubEntityBase).to receive(:entity_name).and_return('Name')
      }

      it 'returns the entity_name' do
        expect(subject.connec_entity_name).to eql('Name')
      end
    end

    context 'when entity is external' do
      it { expect{ subject.connec_entity_name }.to raise_error('Not implemented') }
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
maestrano-connector-rails-0.2.16 spec/models/sub_entity_base_spec.rb
maestrano-connector-rails-0.2.15 spec/models/sub_entity_base_spec.rb
maestrano-connector-rails-0.2.14 spec/models/sub_entity_base_spec.rb
maestrano-connector-rails-0.2.13 spec/models/sub_entity_base_spec.rb
maestrano-connector-rails-0.2.12 spec/models/sub_entity_base_spec.rb
maestrano-connector-rails-0.2.11 spec/models/sub_entity_base_spec.rb
maestrano-connector-rails-0.2.10 spec/models/sub_entity_base_spec.rb
maestrano-connector-rails-0.2.9 spec/models/sub_entity_base_spec.rb
maestrano-connector-rails-0.2.8 spec/models/sub_entity_base_spec.rb
maestrano-connector-rails-0.2.7 spec/models/sub_entity_base_spec.rb
maestrano-connector-rails-0.2.5 spec/models/sub_entity_base_spec.rb
maestrano-connector-rails-0.2.4 spec/models/sub_entity_base_spec.rb
maestrano-connector-rails-0.2.3 spec/models/sub_entity_base_spec.rb
maestrano-connector-rails-0.2.2 spec/models/sub_entity_base_spec.rb
maestrano-connector-rails-0.2.0 spec/models/sub_entity_base_spec.rb
maestrano-connector-rails-0.0.1 spec/models/sub_entity_base_spec.rb