Sha256: 1d839448e444f89529c42515923a9e72deb33c4761bc113fd5f54a051072f5ea

Contents?: true

Size: 420 Bytes

Versions: 1

Compression:

Stored size: 420 Bytes

Contents

shared_examples_for 'a model' do |valid_hash, unique_id_attribute, value|
  it 'can be initialized' do
    expect{ described_class.new(valid_hash) }.not_to raise_error
  end

  describe '.unique_id' do
    let( :model ){ described_class.new( valid_hash.merge({ unique_id_attribute => value })) }

    before{ expect(model.send(unique_id_attribute)).to eq value }

    it{ expect(model.unique_id).to eq value }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fortnox-api-0.2.0 spec/fortnox/api/models/examples/model.rb