geocerts 0.0.15 → 0.0.16
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.
- data/VERSION +1 -1
- data/geocerts.gemspec +1 -1
- data/lib/geo_certs/endpoints/orders.rb +1 -1
- data/lib/geo_certs/order.rb +8 -3
- data/test/fixtures/responses/order.rb +8 -8
- data/test/integrations/order_test.rb +14 -3
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.16
|
data/geocerts.gemspec
CHANGED
data/lib/geo_certs/order.rb
CHANGED
@@ -29,15 +29,14 @@ module GeoCerts
|
|
29
29
|
:csr,
|
30
30
|
:ev_approver,
|
31
31
|
:organization,
|
32
|
-
:
|
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 :
|
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:
|
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
|
-
<
|
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
|
-
<
|
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
|
-
<
|
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:
|
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
|
-
<
|
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:
|
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
|
-
<
|
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.
|
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.
|
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.
|
153
|
+
assert_equal(false, order.flagged)
|
143
154
|
end
|
144
155
|
end
|
145
156
|
|