jortt 3.0.0 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/rspec.yml +40 -0
- data/.ruby-version +1 -1
- data/README.md +81 -46
- data/Rakefile +0 -1
- data/jortt.gemspec +10 -10
- data/lib/jortt.rb +0 -1
- data/lib/jortt/client.rb +75 -23
- data/lib/jortt/client/customers.rb +91 -0
- data/lib/jortt/client/error.rb +33 -0
- data/lib/jortt/client/invoices.rb +80 -0
- data/lib/jortt/client/ledger_accounts.rb +27 -0
- data/lib/jortt/client/version.rb +1 -2
- data/spec/fixtures/vcr_cassettes/Jortt/_client/1_1_1.yml +64 -0
- data/spec/fixtures/vcr_cassettes/Jortt_Client/configured/_customers/1_1_1_1.yml +64 -0
- data/spec/fixtures/vcr_cassettes/Jortt_Client/configured/_invoices/1_1_2_1.yml +64 -0
- data/spec/fixtures/vcr_cassettes/Jortt_Client/configured/_ledger_accounts/1_1_3_1.yml +64 -0
- data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_create/faulty_payload/shows_a_nice_error.yml +413 -0
- data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_create/valid_payload/creates_the_customer.yml +505 -0
- data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_delete/deletes_the_customer.yml +505 -0
- 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
- data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_index/query/returns_the_queried_customers.yml +464 -0
- data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_index/without_params/returns_customers.yml +415 -0
- data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_show/returns_the_customer.yml +464 -0
- data/spec/fixtures/vcr_cassettes/Jortt_Client_Customers/_update/updates_the_customer.yml +603 -0
- data/spec/fixtures/vcr_cassettes/Jortt_Client_Invoices/_create/creates_the_invoice.yml +170 -0
- data/spec/fixtures/vcr_cassettes/Jortt_Client_Invoices/_credit/credits_the_invoice.yml +374 -0
- data/spec/fixtures/vcr_cassettes/Jortt_Client_Invoices/_download/returns_the_invoice_download_link.yml +168 -0
- data/spec/fixtures/vcr_cassettes/Jortt_Client_Invoices/_index/invoice_status/returns_those_invoices.yml +776 -0
- data/spec/fixtures/vcr_cassettes/Jortt_Client_Invoices/_index/query/returns_the_queried_invoices.yml +315 -0
- data/spec/fixtures/vcr_cassettes/Jortt_Client_Invoices/_show/returns_the_invoice.yml +421 -0
- data/spec/fixtures/vcr_cassettes/Jortt_Client_LedgerAccounts/_index/returns_invoices.yml +118 -0
- data/spec/jortt/client/customers_spec.rb +104 -0
- data/spec/jortt/client/invoices_spec.rb +129 -0
- data/spec/jortt/client/ledger_accounts_spec.rb +19 -0
- data/spec/jortt/client_spec.rb +9 -30
- data/spec/{freemle_spec.rb → jortt_spec.rb} +2 -3
- data/spec/spec_helper.rb +18 -4
- metadata +95 -46
- data/.rubocop.yml +0 -26
- data/.travis.yml +0 -7
- data/lib/jortt/client/resource.rb +0 -140
- 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
|