jortt 3.0.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/rspec.yml +40 -0
  3. data/.ruby-version +1 -1
  4. data/README.md +81 -46
  5. data/Rakefile +0 -1
  6. data/jortt.gemspec +10 -10
  7. data/lib/jortt.rb +0 -1
  8. data/lib/jortt/client.rb +75 -23
  9. data/lib/jortt/client/customers.rb +91 -0
  10. data/lib/jortt/client/error.rb +33 -0
  11. data/lib/jortt/client/invoices.rb +80 -0
  12. data/lib/jortt/client/ledger_accounts.rb +27 -0
  13. data/lib/jortt/client/version.rb +1 -2
  14. data/spec/fixtures/vcr_cassettes/Jortt/_client/1_1_1.yml +64 -0
  15. data/spec/fixtures/vcr_cassettes/Jortt_Client/configured/_customers/1_1_1_1.yml +64 -0
  16. data/spec/fixtures/vcr_cassettes/Jortt_Client/configured/_invoices/1_1_2_1.yml +64 -0
  17. data/spec/fixtures/vcr_cassettes/Jortt_Client/configured/_ledger_accounts/1_1_3_1.yml +64 -0
  18. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_create/faulty_payload/shows_a_nice_error.yml +413 -0
  19. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_create/valid_payload/creates_the_customer.yml +505 -0
  20. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_delete/deletes_the_customer.yml +505 -0
  21. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_direct_debit_mandate/sends_direct_debit_mandate_to_the_customer_or_responds_with_an_error_when_not_possible.yml +470 -0
  22. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_index/query/returns_the_queried_customers.yml +464 -0
  23. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_index/without_params/returns_customers.yml +415 -0
  24. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_show/returns_the_customer.yml +464 -0
  25. data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_update/updates_the_customer.yml +603 -0
  26. data/spec/fixtures/vcr_cassettes/Jortt_Client_Invoices/_create/creates_the_invoice.yml +170 -0
  27. data/spec/fixtures/vcr_cassettes/Jortt_Client_Invoices/_credit/credits_the_invoice.yml +374 -0
  28. data/spec/fixtures/vcr_cassettes/Jortt_Client_Invoices/_download/returns_the_invoice_download_link.yml +168 -0
  29. data/spec/fixtures/vcr_cassettes/Jortt_Client_Invoices/_index/invoice_status/returns_those_invoices.yml +776 -0
  30. data/spec/fixtures/vcr_cassettes/Jortt_Client_Invoices/_index/query/returns_the_queried_invoices.yml +315 -0
  31. data/spec/fixtures/vcr_cassettes/Jortt_Client_Invoices/_show/returns_the_invoice.yml +421 -0
  32. data/spec/fixtures/vcr_cassettes/Jortt_Client_LedgerAccounts/_index/returns_invoices.yml +118 -0
  33. data/spec/jortt/client/customers_spec.rb +104 -0
  34. data/spec/jortt/client/invoices_spec.rb +129 -0
  35. data/spec/jortt/client/ledger_accounts_spec.rb +19 -0
  36. data/spec/jortt/client_spec.rb +9 -30
  37. data/spec/{freemle_spec.rb → jortt_spec.rb} +2 -3
  38. data/spec/spec_helper.rb +18 -4
  39. metadata +95 -46
  40. data/.rubocop.yml +0 -26
  41. data/.travis.yml +0 -7
  42. data/lib/jortt/client/resource.rb +0 -140
  43. data/spec/jortt/client/resource_spec.rb +0 -31
@@ -1,31 +0,0 @@
1
- # encoding: UTF-8
2
- require 'spec_helper'
3
-
4
- describe Jortt::Client::Resource do
5
- let(:resource) do
6
- described_class.new(
7
- double('client', base_url: 'foo', app_name: 'app', api_key: 'secret'),
8
- :person,
9
- :people,
10
- )
11
- end
12
-
13
- describe '#search' do
14
- subject { resource.search('terms') }
15
- before do
16
- stub_request(:get, 'http://app:secret@foo/people?query=terms').
17
- to_return(status: 200, body: '{"people": []}')
18
- end
19
- it { should eq('people' => []) }
20
- end
21
-
22
- describe '#create' do
23
- subject { resource.create(foo: :bar) }
24
- before do
25
- stub_request(:post, 'http://app:secret@foo/people').
26
- with(body: '{"person":{"foo":"bar"}}').
27
- to_return(status: 201, body: '{"person_id": "123"}')
28
- end
29
- it { should eq('person_id' => '123') }
30
- end
31
- end