Sha256: 2bddd111c3d6b9a3e870c3c55911f8a283cacbe71eadb7b1099b4cdeab1faf5f

Contents?: true

Size: 545 Bytes

Versions: 11

Compression:

Stored size: 545 Bytes

Contents

# frozen_string_literal: true

shared_examples_for 'a model' do |unique_id|
  let(:required_attributes) { described_class::STUB.dup }
  let(:unique_id_attribute) { described_class::UNIQUE_ID }

  it 'can be initialized' do
    expect { described_class.new(required_attributes) }.not_to raise_error
  end

  describe '.unique_id' do
    subject { model.unique_id }

    let(:model) do
      described_class.new(
        required_attributes.merge(unique_id_attribute => unique_id)
      )
    end

    it { is_expected.to eq unique_id }
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fortnox-api-0.8.2 spec/fortnox/api/models/examples/model.rb
fortnox-api-0.8.1 spec/fortnox/api/models/examples/model.rb
fortnox-api-0.9.0 spec/fortnox/api/models/examples/model.rb
fortnox-api-0.8.0 spec/fortnox/api/models/examples/model.rb
fortnox-api-0.7.2 spec/fortnox/api/models/examples/model.rb
fortnox-api-0.7.1 spec/fortnox/api/models/examples/model.rb
fortnox-api-0.7.0 spec/fortnox/api/models/examples/model.rb
fortnox-api-0.6.3 spec/fortnox/api/models/examples/model.rb
fortnox-api-0.6.2 spec/fortnox/api/models/examples/model.rb
fortnox-api-0.6.1 spec/fortnox/api/models/examples/model.rb
fortnox-api-0.6.0 spec/fortnox/api/models/examples/model.rb