Sha256: 69f77e13838c46a9fdd8b7269a281c145adf937944effa2d2dc655a27f8ce796

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

require 'spec_helper'
require 'fortnox/api'
require 'fortnox/api/mappers'
require 'fortnox/api/repositories/customer'
require 'fortnox/api/repositories/examples/all'
require 'fortnox/api/repositories/examples/find'
require 'fortnox/api/repositories/examples/save'
require 'fortnox/api/repositories/examples/save_with_specially_named_attribute'
require 'fortnox/api/repositories/examples/search'

describe Fortnox::API::Repository::Customer, order: :defined, integration: true do
  subject(:repository){ described_class.new }

  include_examples '.save', :name

  include_examples '.save with specially named attribute',
                   { name: 'Test customer' },
                   :email_invoice_cc,
                   'test@example.com'

  # It is not yet possible to delete Customers. Therefore, expected nr of
  # Customers when running .all will continue to increase
  # (until 100, which is max by default).
  include_examples '.all', 100

  include_examples '.find', '1'

  include_examples '.search', :name, 'Test', 23
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fortnox-api-0.2.0 spec/fortnox/api/repositories/customer_spec.rb