geocerts 0.0.15 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.15
1
+ 0.0.16
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{geocerts}
8
- s.version = "0.0.15"
8
+ s.version = "0.0.16"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["GeoCerts, Inc."]
@@ -20,7 +20,7 @@ module GeoCerts
20
20
  element :sans
21
21
  element :state
22
22
  element 'total-price', :as => :total_price, :type => Float
23
- element 'pending-audit', :as => :pending_audit
23
+ element 'flagged'
24
24
 
25
25
  element :product do
26
26
  element :sku
@@ -29,15 +29,14 @@ module GeoCerts
29
29
  :csr,
30
30
  :ev_approver,
31
31
  :organization,
32
- :pending_audit,
33
- :product,
32
+ :flagged,
34
33
  :renewal,
35
34
  :renewal_information,
36
35
  :trial
37
36
 
38
37
  alias :approver= :approver_email=
39
38
 
40
- force_boolean :pending_audit,
39
+ force_boolean :flagged,
41
40
  :renewal,
42
41
  :trial
43
42
 
@@ -284,8 +283,14 @@ module GeoCerts
284
283
  input
285
284
  when String
286
285
  Product.find(input)
286
+ when Hash
287
+ @_product_id = input[:sku] if input[:sku]; nil
287
288
  end
288
289
  end
290
+
291
+ def product
292
+ @product ||= @_product_id ? Product.find(@_product_id) : nil
293
+ end
289
294
 
290
295
  ##
291
296
  # Sets the extended validation approver for the order. This method
@@ -8,7 +8,7 @@ Server: Mongrel 1.1.3
8
8
  Status: 200 OK
9
9
  Cache-Control: no-cache
10
10
  Content-Type: application/xml; charset=utf-8
11
- Content-Length: 2137
11
+ Content-Length: 2101
12
12
  Vary: Accept-Encoding
13
13
  Connection: close
14
14
 
@@ -29,7 +29,7 @@ Connection: close
29
29
  <sans></sans>
30
30
  <state>COMPLETED</state>
31
31
  <total-price type="float">69</total-price>
32
- <pending-audit type="boolean">false</pending-audit>
32
+ <flagged type="boolean">false</flagged>
33
33
  <product>
34
34
  <sku>Q</sku>
35
35
  </product>
@@ -49,7 +49,7 @@ Connection: close
49
49
  <sans></sans>
50
50
  <state>COMPLETED</state>
51
51
  <total-price type="float">69</total-price>
52
- <pending-audit type="boolean">false</pending-audit>
52
+ <flagged type="boolean">false</flagged>
53
53
  <product>
54
54
  <sku>Q</sku>
55
55
  </product>
@@ -69,7 +69,7 @@ Connection: close
69
69
  <sans></sans>
70
70
  <state>REJECTED</state>
71
71
  <total-price type="float">69</total-price>
72
- <pending-audit type="boolean">false</pending-audit>
72
+ <flagged type="boolean">false</flagged>
73
73
  <product>
74
74
  <sku>Q</sku>
75
75
  </product>
@@ -83,7 +83,7 @@ Server: Mongrel 1.1.3
83
83
  Status: 200 OK
84
84
  Cache-Control: no-cache
85
85
  Content-Type: application/xml; charset=utf-8
86
- Content-Length: 704
86
+ Content-Length: 692
87
87
  Vary: Accept-Encoding
88
88
  Connection: close
89
89
 
@@ -103,7 +103,7 @@ Connection: close
103
103
  <sans></sans>
104
104
  <state>COMPLETED</state>
105
105
  <total-price type="float">69</total-price>
106
- <pending-audit type="boolean">false</pending-audit>
106
+ <flagged type="boolean">false</flagged>
107
107
  <product>
108
108
  <sku>Q</sku>
109
109
  </product>
@@ -116,7 +116,7 @@ Server: Mongrel 1.1.3
116
116
  Status: 200 OK
117
117
  Cache-Control: no-cache
118
118
  Content-Type: application/xml; charset=utf-8
119
- Content-Length: 831
119
+ Content-Length: 820
120
120
  Vary: Accept-Encoding
121
121
  Connection: close
122
122
 
@@ -136,7 +136,7 @@ Connection: close
136
136
  <sans></sans>
137
137
  <state>COMPLETED</state>
138
138
  <total-price type="float">69</total-price>
139
- <pending-audit type="boolean">false</pending-audit>
139
+ <flagged type="boolean">false</flagged>
140
140
  <product>
141
141
  <sku>Q</sku>
142
142
  </product>
@@ -35,7 +35,7 @@ class GeoCerts::OrderTest < Test::Unit::TestCase
35
35
  assert_equal('', order.sans)
36
36
  assert_equal('COMPLETED', order.state)
37
37
  assert_equal(69.00, order.total_price)
38
- assert_equal(false, order.pending_audit)
38
+ assert_equal(false, order.flagged)
39
39
  end
40
40
  end
41
41
 
@@ -92,7 +92,7 @@ class GeoCerts::OrderTest < Test::Unit::TestCase
92
92
  assert_equal('', order.sans)
93
93
  assert_equal('COMPLETED', order.state)
94
94
  assert_equal(69.00, order.total_price)
95
- assert_equal(false, order.pending_audit)
95
+ assert_equal(false, order.flagged)
96
96
  end
97
97
  end
98
98
 
@@ -104,6 +104,17 @@ class GeoCerts::OrderTest < Test::Unit::TestCase
104
104
  end
105
105
  end
106
106
 
107
+ should 'load the product when requested' do
108
+ exclusively_mocked_request :get, "/orders/#{@order_id}.xml", :response => Responses::Order::Order do
109
+ order = GeoCerts::Order.find(@order_id)
110
+ assert_equal(nil, order.instance_variable_get("@product"))
111
+ exclusively_mocked_request :get, "/products.xml", :response => Responses::Product::All do
112
+ assert_kind_of(GeoCerts::Product, order.product)
113
+ assert_equal('Q', order.product.sku)
114
+ end
115
+ end
116
+ end
117
+
107
118
  end
108
119
 
109
120
  context 'find_by_id' do
@@ -139,7 +150,7 @@ class GeoCerts::OrderTest < Test::Unit::TestCase
139
150
  assert_equal('', order.sans)
140
151
  assert_equal('COMPLETED', order.state)
141
152
  assert_equal(69.00, order.total_price)
142
- assert_equal(false, order.pending_audit)
153
+ assert_equal(false, order.flagged)
143
154
  end
144
155
  end
145
156
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 15
9
- version: 0.0.15
8
+ - 16
9
+ version: 0.0.16
10
10
  platform: ruby
11
11
  authors:
12
12
  - GeoCerts, Inc.