active_fulfillment 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0563ad797820f2ba1d68af1225b1c082dc61f711
4
- data.tar.gz: 63d1dbca24a4e63e1b6846a6a4126ffb1edd094c
3
+ metadata.gz: fa12f08bf387a5a267295529073930b450614139
4
+ data.tar.gz: 8ee4d2ae85bc1f90971f7ea3e856e281cfb22b21
5
5
  SHA512:
6
- metadata.gz: 4c8b46503c65b32f078264a26143995007d11c2c2fcdc11b6235cec69f7fa85081a33367e16ef7abb92ed24f98a39f444f18b358e8a68e8bd1e0888b054da1b6
7
- data.tar.gz: 88f5644237742272a5d843b938bb46324c47376fcf21bd8e12a74b57a20fd1ad8306c88e7ef45dfdb30db300564fa40d0acb39e57e80d16fa516f29260263616
6
+ metadata.gz: 9bc7da03cf0ff15982a532c6b2beea0a802dd2774e070178927abe5a8c94c74c56de505e7626e175f3bd342b273c338cd93a346cc20dba582c826acfbe6982a9
7
+ data.tar.gz: fc39d07e52dd61ada87c10ec7644b0d80fde199e1d39fa49e8859e612573785364a28e24a377faad213ce8fc8fc79949b261fdd9675de6f5c44eda2df2636d46
@@ -410,7 +410,8 @@ module ActiveMerchant
410
410
  end
411
411
 
412
412
  def build_address(address)
413
- requires!(address, :name, :address1, :city, :state, :country, :zip)
413
+ requires!(address, :name, :address1, :city, :country, :zip)
414
+ address[:state] ||= "N/A"
414
415
  address[:zip].upcase!
415
416
  ary = address.map{ |key, value| [LOOKUPS[:destination_address][key], value] if LOOKUPS[:destination_address].include?(key) && value.present? }
416
417
  Hash[ary.compact]
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  module ActiveMerchant
3
3
  module Fulfillment
4
- VERSION = "2.1.1"
4
+ VERSION = "2.1.2"
5
5
  end
6
6
  end
data/test/test_helper.rb CHANGED
@@ -5,7 +5,7 @@ require 'rubygems'
5
5
  require 'bundler'
6
6
  Bundler.setup
7
7
 
8
- require 'test/unit'
8
+ require 'minitest/autorun'
9
9
  require 'digest/md5'
10
10
  require 'active_fulfillment'
11
11
  require 'active_utils'
@@ -14,7 +14,7 @@ require 'mocha/setup'
14
14
 
15
15
  module Test
16
16
  module Unit
17
- class TestCase
17
+ class TestCase < MiniTest::Unit::TestCase
18
18
  include ActiveMerchant::Fulfillment
19
19
 
20
20
  LOCAL_CREDENTIALS = ENV['HOME'] + '/.active_merchant/fixtures.yml' unless defined?(LOCAL_CREDENTIALS)
@@ -48,6 +48,18 @@ module Test
48
48
  hash.symbolize_keys!
49
49
  hash.each{|k,v| symbolize_keys(v)}
50
50
  end
51
+
52
+ def assert_raise(error)
53
+ begin
54
+ yield
55
+ rescue => e
56
+ flunk "Expected #{error} but nothing raised" if e.class != error
57
+ end
58
+ end
59
+
60
+ def assert_nothing_raised
61
+ yield
62
+ end
51
63
  end
52
64
  end
53
65
  end
@@ -141,6 +141,22 @@ class AmazonMarketplaceWebServiceTest < Test::Unit::TestCase
141
141
  assert_equal expected_items, @service.build_address(@address)
142
142
  end
143
143
 
144
+ def test_build_address_without_state_succeeds
145
+ expected_items = {
146
+ "DestinationAddress.Name" => @address[:name],
147
+ "DestinationAddress.Line1" => @address[:address1],
148
+ "DestinationAddress.Line2" => @address[:address2],
149
+ "DestinationAddress.City" => @address[:city],
150
+ "DestinationAddress.StateOrProvinceCode" => "N/A",
151
+ "DestinationAddress.CountryCode" => @address[:country],
152
+ "DestinationAddress.PostalCode" => @address[:zip],
153
+ "DestinationAddress.PhoneNumber" => @address[:phone]
154
+ }
155
+ @address.delete(:state)
156
+
157
+ assert_equal expected_items, @service.build_address(@address)
158
+ end
159
+
144
160
  def test_integrated_registration_url_creation
145
161
  service = AmazonMarketplaceWebService.new(:login => "AKIAFJPPO5KLY6G4XO7Q", :password => "aaa", :app_id => "1014f5ad-c359-4e86-8e50-bb8f8e431a9")
146
162
  options = {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_fulfillment
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Fauser
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2010-12-13 00:00:00.000000000 Z
12
+ date: 2014-05-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -81,6 +81,20 @@ dependencies:
81
81
  - - '>='
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
+ - !ruby/object:Gem::Dependency
85
+ name: minitest
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - '>='
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - '>='
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
84
98
  - !ruby/object:Gem::Dependency
85
99
  name: rdoc
86
100
  requirement: !ruby/object:Gem::Requirement
@@ -101,17 +115,18 @@ executables: []
101
115
  extensions: []
102
116
  extra_rdoc_files: []
103
117
  files:
118
+ - CHANGELOG
119
+ - lib/active_fulfillment.rb
104
120
  - lib/active_fulfillment/fulfillment/base.rb
105
121
  - lib/active_fulfillment/fulfillment/response.rb
106
122
  - lib/active_fulfillment/fulfillment/service.rb
123
+ - lib/active_fulfillment/fulfillment/services.rb
107
124
  - lib/active_fulfillment/fulfillment/services/amazon.rb
108
125
  - lib/active_fulfillment/fulfillment/services/amazon_mws.rb
109
126
  - lib/active_fulfillment/fulfillment/services/shipwire.rb
110
127
  - lib/active_fulfillment/fulfillment/services/webgistix.rb
111
- - lib/active_fulfillment/fulfillment/services.rb
112
128
  - lib/active_fulfillment/fulfillment/version.rb
113
- - lib/active_fulfillment.rb
114
- - CHANGELOG
129
+ - test/fixtures.yml
115
130
  - test/fixtures/xml/amazon/inventory_get_response.xml
116
131
  - test/fixtures/xml/amazon/inventory_list_response.xml
117
132
  - test/fixtures/xml/amazon/inventory_list_response_with_next_1.xml
@@ -138,7 +153,6 @@ files:
138
153
  - test/fixtures/xml/shipwire/successful_tracking_response_with_tracking_urls.xml
139
154
  - test/fixtures/xml/webgistix/multiple_tracking_response.xml
140
155
  - test/fixtures/xml/webgistix/tracking_response.xml
141
- - test/fixtures.yml
142
156
  - test/remote/amazon_mws_test.rb
143
157
  - test/remote/amazon_test.rb
144
158
  - test/remote/shipwire_test.rb
@@ -168,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
182
  version: '0'
169
183
  requirements: []
170
184
  rubyforge_project:
171
- rubygems_version: 2.0.3
185
+ rubygems_version: 2.2.2
172
186
  signing_key:
173
187
  specification_version: 4
174
188
  summary: Framework and tools for dealing with shipping, tracking and order fulfillment