shipcloud 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.circleci/config.yml +62 -0
- data/.rubocop.yml +310 -313
- data/CHANGELOG.md +32 -0
- data/Gemfile +2 -1
- data/README.md +3 -1
- data/Rakefile +5 -4
- data/bin/setup +7 -0
- data/lib/shipcloud/address.rb +3 -1
- data/lib/shipcloud/base.rb +5 -5
- data/lib/shipcloud/carrier.rb +2 -0
- data/lib/shipcloud/operations/all.rb +2 -0
- data/lib/shipcloud/operations/create.rb +3 -1
- data/lib/shipcloud/operations/delete.rb +2 -0
- data/lib/shipcloud/operations/find.rb +3 -1
- data/lib/shipcloud/operations/update.rb +19 -13
- data/lib/shipcloud/order.rb +15 -0
- data/lib/shipcloud/pickup_request.rb +2 -0
- data/lib/shipcloud/request/base.rb +2 -0
- data/lib/shipcloud/request/connection.rb +11 -3
- data/lib/shipcloud/request/info.rb +6 -5
- data/lib/shipcloud/shipcloud_error.rb +7 -0
- data/lib/shipcloud/shipment.rb +5 -2
- data/lib/shipcloud/shipment_quote.rb +2 -0
- data/lib/shipcloud/tracker.rb +1 -0
- data/lib/shipcloud/version.rb +3 -1
- data/lib/shipcloud/webhook.rb +2 -0
- data/lib/shipcloud.rb +1 -0
- data/shipcloud.gemspec +7 -6
- data/spec/shipcloud/address_spec.rb +66 -40
- data/spec/shipcloud/carrier_spec.rb +53 -52
- data/spec/shipcloud/order_spec.rb +188 -0
- data/spec/shipcloud/pickup_request_spec.rb +14 -13
- data/spec/shipcloud/request/base_spec.rb +3 -2
- data/spec/shipcloud/request/connection_spec.rb +1 -0
- data/spec/shipcloud/shipcloud_error_spec.rb +8 -7
- data/spec/shipcloud/shipment_quote_spec.rb +5 -4
- data/spec/shipcloud/shipment_spec.rb +146 -62
- data/spec/shipcloud/webhooks_spec.rb +5 -4
- data/spec/shipcloud_spec.rb +5 -2
- data/spec/spec_helper.rb +3 -2
- metadata +25 -24
- data/.hound.yml +0 -12
- data/.travis.yml +0 -27
- data/install-cc-test-reporter.sh +0 -4
data/CHANGELOG.md
CHANGED
@@ -11,6 +11,38 @@
|
|
11
11
|
|
12
12
|
### Security
|
13
13
|
|
14
|
+
## [0.12.0] - 2022-12-06
|
15
|
+
### Added
|
16
|
+
- Add order model
|
17
|
+
- Add attr_accessor for `service` to class `Shipcloud::Shipment` to be able to access the service attribute at the shipment object.
|
18
|
+
- Add attr_accessor for `additional_services` to class `Shipcloud::Shipment` to be able to access the additional_services attribute at the shipment object.
|
19
|
+
- Add attr_reader for `label_voucher_url` to class `Shipcloud::Shipment` to be able to read the label_voucher_url (QR Code url) attribute at the shipment object.
|
20
|
+
- Added missing `frozen_string_literal: true` magic comments to files
|
21
|
+
|
22
|
+
### Changed
|
23
|
+
- Ensure compatibility with ruby 2.x and 3.x
|
24
|
+
- Set required ruby version to >= 2.6
|
25
|
+
- Replace Travis CI with CircleCI
|
26
|
+
- Specify simplecov to be ~> 0.21.0
|
27
|
+
- Specify `rubocop` to be `~> 1.10.0`
|
28
|
+
- Specify `rubocop-performance` to be `~> 1.7.0`
|
29
|
+
|
30
|
+
### Deprecated
|
31
|
+
|
32
|
+
### Removed
|
33
|
+
- Drop support for Ruby <= 2.5
|
34
|
+
- Drop support for RBX
|
35
|
+
|
36
|
+
### Fixed
|
37
|
+
- Fix rubocop styling issues
|
38
|
+
|
39
|
+
### Security
|
40
|
+
|
41
|
+
## [0.11.0] - 2020-07-28
|
42
|
+
### Added
|
43
|
+
- Support shipments with pickup requests as required for [TNT](https://developers.shipcloud.io/carriers/tnt.html).
|
44
|
+
- Add attr_accessor for `email` to class `Shipcloud::Address` to be able to access the email attribute at the address object.
|
45
|
+
|
14
46
|
## [0.10.0] - 2019-08-07
|
15
47
|
### Added
|
16
48
|
- Add the possibility to specify custom affiliate_id on every request
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
[](https://circleci.com/gh/shipcloud/shipcloud-ruby/tree/master)
|
2
|
+
[](https://codeclimate.com/github/shipcloud/shipcloud-ruby/maintainability)
|
3
|
+
[](https://codeclimate.com/github/shipcloud/shipcloud-ruby/test_coverage)
|
2
4
|
|
3
5
|
# shipcloud
|
4
6
|
|
data/Rakefile
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require "bundler/gem_tasks"
|
2
|
-
require
|
3
|
+
require "rspec/core/rake_task"
|
3
4
|
|
4
5
|
RSpec::Core::RakeTask.new(:spec)
|
5
6
|
|
6
7
|
task :console do
|
7
|
-
require
|
8
|
-
require
|
9
|
-
require
|
8
|
+
require "irb"
|
9
|
+
require "irb/completion"
|
10
|
+
require "shipcloud"
|
10
11
|
ARGV.clear
|
11
12
|
IRB.start
|
12
13
|
end
|
data/bin/setup
ADDED
data/lib/shipcloud/address.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Shipcloud
|
2
4
|
class Address < Base
|
3
5
|
include Shipcloud::Operations::Update
|
4
6
|
include Shipcloud::Operations::All
|
5
7
|
|
6
|
-
attr_accessor :company, :first_name, :last_name, :care_of, :street,
|
8
|
+
attr_accessor :company, :first_name, :last_name, :care_of, :street, :email,
|
7
9
|
:street_no, :zip_code, :city, :state, :country, :phone
|
8
10
|
attr_reader :id
|
9
11
|
|
data/lib/shipcloud/base.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Shipcloud
|
2
4
|
class Base
|
3
5
|
include Shipcloud::Operations::Create
|
@@ -28,17 +30,15 @@ module Shipcloud
|
|
28
30
|
end
|
29
31
|
|
30
32
|
def self.class_name
|
31
|
-
|
33
|
+
name.split("::").last
|
32
34
|
end
|
33
35
|
|
34
36
|
def self.base_url
|
35
37
|
"#{class_name.downcase}s"
|
36
38
|
end
|
37
39
|
|
38
|
-
def self.create_response_root
|
39
|
-
end
|
40
|
+
def self.create_response_root; end
|
40
41
|
|
41
|
-
def self.index_response_root
|
42
|
-
end
|
42
|
+
def self.index_response_root; end
|
43
43
|
end
|
44
44
|
end
|
data/lib/shipcloud/carrier.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Shipcloud
|
2
4
|
module Operations
|
3
5
|
module Create
|
@@ -18,7 +20,7 @@ module Shipcloud
|
|
18
20
|
if create_response_root
|
19
21
|
response = response.fetch(create_response_root, {})
|
20
22
|
end
|
21
|
-
|
23
|
+
new(response)
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
@@ -1,18 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Shipcloud
|
2
4
|
module Operations
|
3
5
|
module Update
|
4
|
-
|
5
6
|
module ClassMethods
|
6
|
-
# Updates
|
7
|
+
# Updates an object
|
7
8
|
# @param [String] id The id of the object that should be updated
|
8
9
|
# @param [Hash] attributes The attributes that should be updated
|
9
|
-
# @param
|
10
|
+
# @param [String] optional api_key The api key. If no api key is given, Shipcloud.api_key
|
10
11
|
# will be used for the request
|
11
|
-
|
12
|
+
# @param [String] optional affiliate_id Your affiliate ID. If no affiliate ID is given,
|
13
|
+
# Shipcloud.affiliate_id will be used for the request
|
14
|
+
def update(id, attributes = {}, **kwargs)
|
15
|
+
attributes.merge!(kwargs)
|
16
|
+
options = attributes.slice(:api_key, :affiliate_id) || {}
|
17
|
+
attributes.reject! { |key| [:api_key, :affiliate_id].include?(key) }
|
12
18
|
response = Shipcloud.request(
|
13
|
-
:put, "#{base_url}/#{id}", attributes,
|
19
|
+
:put, "#{base_url}/#{id}", attributes,
|
20
|
+
api_key: options[:api_key], affiliate_id: options[:affiliate_id]
|
14
21
|
)
|
15
|
-
|
22
|
+
new(response)
|
16
23
|
end
|
17
24
|
end
|
18
25
|
|
@@ -20,16 +27,15 @@ module Shipcloud
|
|
20
27
|
base.extend(ClassMethods)
|
21
28
|
end
|
22
29
|
|
23
|
-
# Updates
|
30
|
+
# Updates an object
|
24
31
|
#
|
25
32
|
# @param [Hash] attributes The attributes that should be updated
|
26
|
-
# @param
|
33
|
+
# @param [String] optional api_key The api key. If no api key is given, Shipcloud.api_key
|
27
34
|
# will be used for the request
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
)
|
32
|
-
set_attributes(response)
|
35
|
+
# @param [String] optional affiliate_id Your affiliate ID. If no affiliate ID is given,
|
36
|
+
# Shipcloud.affiliate_id will be used for the request
|
37
|
+
def update(attributes = {}, **kwargs)
|
38
|
+
self.class.update(id, attributes, **kwargs)
|
33
39
|
end
|
34
40
|
end
|
35
41
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Shipcloud
|
4
|
+
class Order < Base
|
5
|
+
include Shipcloud::Operations::All
|
6
|
+
include Shipcloud::Operations::Find
|
7
|
+
include Shipcloud::Operations::Create
|
8
|
+
include Shipcloud::Operations::Delete
|
9
|
+
|
10
|
+
attr_reader :id
|
11
|
+
attr_accessor :external_customer_id, :external_order_id, :placed_at, :total_price, :total_vat,
|
12
|
+
:currency, :total_weight, :weight_unit, :refundable_until,
|
13
|
+
:refund_deduction_amount, :delivery_address, :order_line_items, :metadata
|
14
|
+
end
|
15
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Shipcloud
|
2
4
|
module Request
|
3
5
|
class Connection
|
@@ -9,12 +11,18 @@ module Shipcloud
|
|
9
11
|
|
10
12
|
def setup_https
|
11
13
|
if Shipcloud.configuration.use_ssl
|
12
|
-
@https
|
14
|
+
@https = Net::HTTP.new(
|
15
|
+
Shipcloud.configuration.api_base,
|
16
|
+
Net::HTTP.https_default_port,
|
17
|
+
)
|
13
18
|
@https.use_ssl = true
|
14
19
|
@https.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
15
20
|
else
|
16
|
-
@https
|
17
|
-
|
21
|
+
@https = Net::HTTP.new(
|
22
|
+
Shipcloud.configuration.api_base,
|
23
|
+
Net::HTTP.http_default_port,
|
24
|
+
)
|
25
|
+
@https.use_ssl = false
|
18
26
|
end
|
19
27
|
@https.set_debug_output $stdout if Shipcloud.configuration.debug
|
20
28
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Shipcloud
|
2
4
|
module Request
|
3
5
|
class Info
|
@@ -12,16 +14,15 @@ module Shipcloud
|
|
12
14
|
end
|
13
15
|
|
14
16
|
def url
|
15
|
-
|
16
|
-
url
|
17
|
+
"/#{API_VERSION}/#{api_url}"
|
17
18
|
end
|
18
19
|
|
19
20
|
def path_with_params(path, params)
|
20
|
-
|
21
|
+
if params.empty?
|
22
|
+
path
|
23
|
+
else
|
21
24
|
encoded_params = URI.encode_www_form(params)
|
22
25
|
[path, encoded_params].join("?")
|
23
|
-
else
|
24
|
-
path
|
25
26
|
end
|
26
27
|
end
|
27
28
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Shipcloud
|
2
4
|
class ShipcloudError < StandardError
|
3
5
|
attr_reader :errors, :response
|
@@ -59,10 +61,15 @@ module Shipcloud
|
|
59
61
|
|
60
62
|
# Raised on errors in the 400-499 range
|
61
63
|
class ClientError < ShipcloudError; end
|
64
|
+
|
62
65
|
class AuthenticationError < ClientError; end
|
66
|
+
|
63
67
|
class ForbiddenError < ClientError; end
|
68
|
+
|
64
69
|
class InvalidRequestError < ClientError; end
|
70
|
+
|
65
71
|
class TooManyRequests < ClientError; end
|
72
|
+
|
66
73
|
class NotFoundError < ClientError; end
|
67
74
|
|
68
75
|
# Raised on errors in the 500-599 range
|
data/lib/shipcloud/shipment.rb
CHANGED
@@ -1,12 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Shipcloud
|
2
4
|
class Shipment < Base
|
3
5
|
include Shipcloud::Operations::Delete
|
4
6
|
include Shipcloud::Operations::Update
|
5
7
|
include Shipcloud::Operations::All
|
6
8
|
|
7
|
-
attr_accessor :from, :to, :carrier, :package, :reference_number, :metadata
|
9
|
+
attr_accessor :from, :to, :carrier, :service, :package, :reference_number, :metadata,
|
10
|
+
:additional_services
|
8
11
|
attr_reader :id, :created_at, :carrier_tracking_no, :tracking_url, :label_url,
|
9
|
-
:packages, :price, :customs_declaration
|
12
|
+
:packages, :price, :customs_declaration, :pickup, :label_voucher_url
|
10
13
|
|
11
14
|
def self.index_response_root
|
12
15
|
"#{class_name.downcase}s"
|
data/lib/shipcloud/tracker.rb
CHANGED
data/lib/shipcloud/version.rb
CHANGED
data/lib/shipcloud/webhook.rb
CHANGED
data/lib/shipcloud.rb
CHANGED
@@ -21,6 +21,7 @@ module Shipcloud
|
|
21
21
|
autoload :Shipment, "shipcloud/shipment"
|
22
22
|
autoload :Carrier, "shipcloud/carrier"
|
23
23
|
autoload :Address, "shipcloud/address"
|
24
|
+
autoload :Order, "shipcloud/order"
|
24
25
|
autoload :PickupRequest, "shipcloud/pickup_request"
|
25
26
|
autoload :ShipmentQuote, "shipcloud/shipment_quote"
|
26
27
|
autoload :Tracker, "shipcloud/tracker"
|
data/shipcloud.gemspec
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
# coding: utf-8
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
lib = File.expand_path("lib", __dir__)
|
3
5
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
6
|
require "shipcloud/version"
|
@@ -15,18 +17,17 @@ Gem::Specification.new do |spec|
|
|
15
17
|
spec.license = "MIT"
|
16
18
|
|
17
19
|
spec.files = `git ls-files`.split($/)
|
18
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
20
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
21
|
spec.require_paths = ["lib"]
|
21
22
|
|
22
|
-
spec.required_ruby_version = ">= 2.
|
23
|
+
spec.required_ruby_version = ">= 2.6"
|
23
24
|
|
24
25
|
spec.add_runtime_dependency "json", ">= 1.8.0"
|
25
26
|
spec.add_development_dependency "pry", "~> 0.10"
|
26
|
-
spec.add_development_dependency "rake", "~>
|
27
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
27
28
|
spec.add_development_dependency "rspec", "~> 3.6"
|
28
|
-
spec.add_development_dependency "rubocop", "~>
|
29
|
-
spec.add_development_dependency "rubocop-performance"
|
30
|
-
spec.add_development_dependency "simplecov"
|
29
|
+
spec.add_development_dependency "rubocop", "~> 1.10.0"
|
30
|
+
spec.add_development_dependency "rubocop-performance", "~> 1.7.0"
|
31
|
+
spec.add_development_dependency "simplecov", "~> 0.21.0"
|
31
32
|
spec.add_development_dependency "webmock", "~> 3.0"
|
32
33
|
end
|
@@ -1,40 +1,43 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
# frozen_string_literal: true
|
3
|
+
require "spec_helper"
|
3
4
|
|
4
5
|
describe Shipcloud::Address do
|
5
6
|
valid_attributes = {
|
6
|
-
company:
|
7
|
-
first_name:
|
8
|
-
last_name:
|
9
|
-
care_of:
|
10
|
-
street:
|
11
|
-
street_no:
|
12
|
-
zip_code:
|
13
|
-
city:
|
14
|
-
state:
|
15
|
-
country:
|
16
|
-
phone:
|
7
|
+
company: "shipcloud GmbH",
|
8
|
+
first_name: "Maxi",
|
9
|
+
last_name: "Musterfrau",
|
10
|
+
care_of: "Mustermann",
|
11
|
+
street: "Musterstraße",
|
12
|
+
street_no: "123",
|
13
|
+
zip_code: "12345",
|
14
|
+
city: "Hamburg",
|
15
|
+
state: "Hamburg",
|
16
|
+
country: "DE",
|
17
|
+
phone: "040/123456789",
|
18
|
+
email: "max@mustermail.com",
|
17
19
|
}
|
18
20
|
|
19
|
-
describe
|
20
|
-
it
|
21
|
+
describe "#initialize" do
|
22
|
+
it "initializes all attributes correctly" do
|
21
23
|
address = Shipcloud::Address.new(valid_attributes)
|
22
|
-
expect(address.company).to eq
|
23
|
-
expect(address.first_name).to eq
|
24
|
-
expect(address.last_name).to eq
|
25
|
-
expect(address.care_of).to eq
|
26
|
-
expect(address.street).to eq
|
27
|
-
expect(address.street_no).to eq
|
28
|
-
expect(address.zip_code).to eq
|
29
|
-
expect(address.city).to eq
|
30
|
-
expect(address.state).to eq
|
31
|
-
expect(address.country).to eq
|
32
|
-
expect(address.phone).to eq
|
24
|
+
expect(address.company).to eq "shipcloud GmbH"
|
25
|
+
expect(address.first_name).to eq "Maxi"
|
26
|
+
expect(address.last_name).to eq "Musterfrau"
|
27
|
+
expect(address.care_of).to eq "Mustermann"
|
28
|
+
expect(address.street).to eq "Musterstraße"
|
29
|
+
expect(address.street_no).to eq "123"
|
30
|
+
expect(address.zip_code).to eq "12345"
|
31
|
+
expect(address.city).to eq "Hamburg"
|
32
|
+
expect(address.state).to eq "Hamburg"
|
33
|
+
expect(address.country).to eq "DE"
|
34
|
+
expect(address.phone).to eq "040/123456789"
|
35
|
+
expect(address.email).to eq "max@mustermail.com"
|
33
36
|
end
|
34
37
|
end
|
35
38
|
|
36
|
-
describe
|
37
|
-
it
|
39
|
+
describe ".create" do
|
40
|
+
it "makes a new POST request using the correct API endpoint" do
|
38
41
|
expect(Shipcloud).to receive(:request).
|
39
42
|
with(:post, "addresses", valid_attributes, api_key: nil, affiliate_id: nil).
|
40
43
|
and_return("data" => {})
|
@@ -63,10 +66,11 @@ describe Shipcloud::Address do
|
|
63
66
|
end
|
64
67
|
end
|
65
68
|
|
66
|
-
describe
|
67
|
-
it
|
69
|
+
describe ".find" do
|
70
|
+
it "makes a new GET request using the correct API endpoint to receive a specific address" do
|
68
71
|
expect(Shipcloud).to receive(:request).with(
|
69
|
-
:get, "addresses/123", {}, api_key: nil, affiliate_id: nil
|
72
|
+
:get, "addresses/123", {}, api_key: nil, affiliate_id: nil
|
73
|
+
).and_return("id" => "123")
|
70
74
|
|
71
75
|
Shipcloud::Address.find("123")
|
72
76
|
end
|
@@ -80,8 +84,8 @@ describe Shipcloud::Address do
|
|
80
84
|
end
|
81
85
|
end
|
82
86
|
|
83
|
-
describe
|
84
|
-
it
|
87
|
+
describe ".update" do
|
88
|
+
it "makes a new PUT request using the correct API endpoint" do
|
85
89
|
expect(Shipcloud).to receive(:request).with(
|
86
90
|
:put, "addresses/123", { street: "Mittelweg" }, api_key: nil, affiliate_id: nil
|
87
91
|
).and_return("data" => {})
|
@@ -98,15 +102,15 @@ describe Shipcloud::Address do
|
|
98
102
|
end
|
99
103
|
end
|
100
104
|
|
101
|
-
describe
|
102
|
-
it
|
105
|
+
describe ".all" do
|
106
|
+
it "makes a new Get request using the correct API endpoint" do
|
103
107
|
expect(Shipcloud).to receive(:request).
|
104
108
|
with(:get, "addresses", {}, api_key: nil, affiliate_id: nil).and_return([])
|
105
109
|
|
106
110
|
Shipcloud::Address.all
|
107
111
|
end
|
108
112
|
|
109
|
-
it
|
113
|
+
it "returns a list of Address objects" do
|
110
114
|
stub_addresses_request
|
111
115
|
|
112
116
|
addresses = Shipcloud::Address.all
|
@@ -127,6 +131,28 @@ describe Shipcloud::Address do
|
|
127
131
|
end
|
128
132
|
end
|
129
133
|
|
134
|
+
describe "#update" do
|
135
|
+
it "makes a new PUT request using the correct API endpoint" do
|
136
|
+
expect(Shipcloud).to receive(:request).with(
|
137
|
+
:put, "addresses/123", { street: "Mittelweg" }, api_key: nil, affiliate_id: nil
|
138
|
+
).and_return("data" => {})
|
139
|
+
|
140
|
+
address = Shipcloud::Address.new(id: "123")
|
141
|
+
|
142
|
+
address.update(street: "Mittelweg")
|
143
|
+
end
|
144
|
+
|
145
|
+
it "uses the affiliate ID provided for the request" do
|
146
|
+
expect(Shipcloud).to receive(:request).with(
|
147
|
+
:put, "addresses/123", { street: "Mittelweg" }, api_key: nil, affiliate_id: "affiliate_id"
|
148
|
+
).and_return("data" => {})
|
149
|
+
|
150
|
+
address = Shipcloud::Address.new(id: "123")
|
151
|
+
|
152
|
+
address.update({ street: "Mittelweg" }, affiliate_id: "affiliate_id")
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
130
156
|
def stub_addresses_request(affiliate_id: nil)
|
131
157
|
allow(Shipcloud).to receive(:request).
|
132
158
|
with(:get, "addresses", {}, api_key: nil, affiliate_id: affiliate_id).
|
@@ -144,7 +170,7 @@ describe Shipcloud::Address do
|
|
144
170
|
"city" => "Musterstadt",
|
145
171
|
"state" => "",
|
146
172
|
"country" => "DE",
|
147
|
-
"phone" => ""
|
173
|
+
"phone" => "",
|
148
174
|
},
|
149
175
|
{
|
150
176
|
"id" => "7ea2a290-b456-4ecf-9010-e82b3da298f0",
|
@@ -158,9 +184,9 @@ describe Shipcloud::Address do
|
|
158
184
|
"city" => "Musterstadt",
|
159
185
|
"state" => "",
|
160
186
|
"country" => "DE",
|
161
|
-
"phone" => ""
|
162
|
-
}
|
163
|
-
]
|
187
|
+
"phone" => "",
|
188
|
+
},
|
189
|
+
],
|
164
190
|
)
|
165
191
|
end
|
166
192
|
|