Sha256: d15409d283f64757462f031c2e00987527df0c572b0828264e317018aa98993e

Contents?: true

Size: 484 Bytes

Versions: 11

Compression:

Stored size: 484 Bytes

Contents

# frozen_string_literal: true

require 'fortnox/api/models/examples/model'

shared_examples_for 'DocumentBase Model' do |row_class, row_attribute, valid_row_hash: {}|
  it_behaves_like 'a model', 1

  context "when having a(n) #{row_class}" do
    it 'returns the correct object' do
      row = row_class.new(valid_row_hash)
      document = described_class.new(customer_number: '123', row_attribute => [row])
      expect(document.send(row_attribute)).to eq([row])
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

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