Sha256: 79939f1970f4483012245f2a8b1b09752b6ac7ba2ad18a8c4cc65ef100616e05

Contents?: true

Size: 1.1 KB

Versions: 3

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', 31

  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

3 entries across 3 versions & 1 rubygems

Version Path
fortnox-api-0.7.2 spec/fortnox/api/repositories/project_spec.rb
fortnox-api-0.7.1 spec/fortnox/api/repositories/project_spec.rb
fortnox-api-0.7.0 spec/fortnox/api/repositories/project_spec.rb