Sha256: 2b21e9c0fb804310059a8287b64c8d86c3550c42fb54d138455edd165c62079f

Contents?: true

Size: 1.1 KB

Versions: 1

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

require 'spec_helper'
require 'fortnox/api'
require 'fortnox/api/mappers'
require 'fortnox/api/repositories/project'
require 'fortnox/api/repositories/examples/all'
require 'fortnox/api/repositories/examples/find'
require 'fortnox/api/repositories/examples/save'

describe Fortnox::API::Repository::Project, order: :defined, integration: true do
  include Helpers::Configuration

  before { set_api_test_configuration }

  subject(:repository) { described_class.new }

  include_examples '.save',
                   :comments,
                   additional_attrs: { description: 'Some important project' }

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

  include_examples '.find', '1' do
    let(:find_by_hash_failure) { { offset: 10_000 } }
    let(:single_param_find_by_hash) { { find_hash: { limit: 1 }, matches: 1 } }

    let(:multi_param_find_by_hash) do
      { find_hash: { limit: 2, offset: 2 }, matches: 2 }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fortnox-api-0.8.0 spec/fortnox/api/repositories/project_spec.rb