Skip to content

Commit 164ca89

Browse files
authored
Merge pull request #3 from patch-technology/bs/integration-test
Remove VCR and test with production sandbox account
2 parents c6c0d54 + 0ccde13 commit 164ca89

15 files changed

+105
-1381
lines changed

.github/workflows/test.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,5 @@ jobs:
2323

2424
- name: Run RSpec
2525
env:
26-
PATCH_RUBY_HOST: 'https://api.staging-patch.com/'
27-
PATCH_RUBY_API_KEY: 'key_test_1234'
26+
PATCH_RUBY_API_KEY: ${{ secrets.SANDBOX_API_KEY }}
2827
run: bundle exec rspec
29-

Gemfile

-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ group :development, :test do
66
gem 'rake', '~> 13.0.1'
77
gem 'pry-byebug'
88
gem 'rubocop', '~> 0.66.0'
9-
gem 'vcr', '~> 6.0'
109
end

Gemfile.lock

-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ GEM
5555
typhoeus (1.4.0)
5656
ethon (>= 0.9.0)
5757
unicode-display_width (1.5.0)
58-
vcr (6.0.0)
5958

6059
PLATFORMS
6160
ruby
@@ -66,7 +65,6 @@ DEPENDENCIES
6665
rake (~> 13.0.1)
6766
rspec (~> 3.6, >= 3.6.0)
6867
rubocop (~> 0.66.0)
69-
vcr (~> 6.0)
7068

7169
BUNDLED WITH
7270
2.1.4

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Patch ruby
1+
# Patch Ruby SDK
22
![Test](https://github.com/patch-technology/patch-ruby/workflows/Test/badge.svg)
33
[![Gem Version](https://badge.fury.io/rb/patch_ruby.svg)](https://badge.fury.io/rb/patch_ruby)
44

55
The official Ruby gem for the [Patch API](https://www.usepatch.com)
66

77
## Documentation
88

9-
For detailed documentation and examples, see the [Patch API docs](https://www.usepatch.com).
9+
For detailed documentation and examples, see the [Patch API docs](https://docs.usepatch.com).
1010

1111
## Installation
1212

spec/api_client_spec.rb

+12-33
Original file line numberDiff line numberDiff line change
@@ -10,43 +10,22 @@
1010
1111
=end
1212

13-
require 'spec_helper'
14-
1513
describe Patch::ApiClient do
1614
context 'initialization' do
17-
context 'URL stuff' do
18-
context 'host' do
19-
it 'removes http from host' do
20-
Patch.configure { |c| c.host = 'http://example.com' }
21-
expect(Patch::Configuration.default.host).to eq('example.com')
22-
end
23-
24-
it 'removes https from host' do
25-
Patch.configure { |c| c.host = 'https://wookiee.com' }
26-
expect(Patch::ApiClient.default.config.host).to eq('wookiee.com')
27-
end
28-
29-
it 'removes trailing path from host' do
30-
Patch.configure { |c| c.host = 'hobo.com/v4' }
31-
expect(Patch::Configuration.default.host).to eq('hobo.com')
32-
end
15+
context 'base_path' do
16+
it "prepends a slash to base_path" do
17+
Patch.configure { |c| c.base_path = 'v4/dog' }
18+
expect(Patch::Configuration.default.base_path).to eq('/v4/dog')
19+
end
20+
21+
it "doesn't prepend a slash if one is already there" do
22+
Patch.configure { |c| c.base_path = '/v4/dog' }
23+
expect(Patch::Configuration.default.base_path).to eq('/v4/dog')
3324
end
3425

35-
context 'base_path' do
36-
it "prepends a slash to base_path" do
37-
Patch.configure { |c| c.base_path = 'v4/dog' }
38-
expect(Patch::Configuration.default.base_path).to eq('/v4/dog')
39-
end
40-
41-
it "doesn't prepend a slash if one is already there" do
42-
Patch.configure { |c| c.base_path = '/v4/dog' }
43-
expect(Patch::Configuration.default.base_path).to eq('/v4/dog')
44-
end
45-
46-
it "ends up as a blank string if nil" do
47-
Patch.configure { |c| c.base_path = nil }
48-
expect(Patch::Configuration.default.base_path).to eq('')
49-
end
26+
it "ends up as a blank string if nil" do
27+
Patch.configure { |c| c.base_path = nil }
28+
expect(Patch::Configuration.default.base_path).to eq('')
5029
end
5130
end
5231
end

spec/fixtures/vcr_cassettes/estimate_orders.yml

-276
This file was deleted.

0 commit comments

Comments
 (0)