Sha256: 2821cc6a2c92f2110f2f01a38a4648a8ff0dc3a308dbe4ba08354078eecab9a8

Contents?: true

Size: 751 Bytes

Versions: 6

Compression:

Stored size: 751 Bytes

Contents

require 'spec_helper'
require 'fortnox/api/types'
require 'fortnox/api/types/examples/types'

describe Fortnox::API::Types do
  let( :klass ){ Fortnox::API::Types::AccountNumber }

  context 'AccountNumber created with nil' do
    subject{ klass[ nil ] }
    it{ is_expected.to be_nil }
  end

  context 'AccountNumber created with empty string' do
    include_examples 'raises ConstraintError', ''
  end

  context 'AccountNumber created with valid number' do
    include_examples 'equals input', 1234
  end

  context 'AccountNumber created with a too large number' do
    include_examples 'raises ConstraintError', 10000
  end

  context 'AccountNumber created with a negative number' do
    include_examples 'raises ConstraintError', -1
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fortnox-api-0.5.2 spec/fortnox/api/types/account_number_spec.rb
fortnox-api-0.5.1 spec/fortnox/api/types/account_number_spec.rb
fortnox-api-0.5.0 spec/fortnox/api/types/account_number_spec.rb
fortnox-api-0.4.0 spec/fortnox/api/types/account_number_spec.rb
fortnox-api-0.3.0 spec/fortnox/api/types/account_number_spec.rb
fortnox-api-0.2.0 spec/fortnox/api/types/account_number_spec.rb