Sha256: c563f134b4074e21d520f2c5b52c2d10283abc8d97080ac0a9ba5ce527b1c65a

Contents?: true

Size: 630 Bytes

Versions: 5

Compression:

Stored size: 630 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe Pupa::Concerns::Identifiable do
  let :klass do
    Class.new(Pupa::Base) do
      include Pupa::Concerns::Identifiable
    end
  end

  let :object do
    klass.new
  end

  describe '#add_identifier' do
    it 'should add an identifier' do
      object.add_identifier('123456789', scheme: 'duns')
      object.identifiers.should == [{identifier: '123456789', scheme: 'duns'}]
    end

    it 'should not add an identifier without an identifier' do
      object.add_identifier(nil)
      object.identifiers.blank?.should == true
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pupa-0.0.5 spec/models/concerns/identifiable_spec.rb
pupa-0.0.4 spec/models/concerns/identifiable_spec.rb
pupa-0.0.3 spec/models/concerns/identifiable_spec.rb
pupa-0.0.2 spec/models/concerns/identifiable_spec.rb
pupa-0.0.1 spec/models/concerns/identifiable_spec.rb