solidus_api 2.3.1 → 2.4.0.beta1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of solidus_api might be problematic. Click here for more details.

Files changed (234) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/spree/api/base_controller.rb +9 -12
  3. data/app/controllers/spree/api/checkouts_controller.rb +3 -5
  4. data/app/controllers/spree/api/orders_controller.rb +2 -12
  5. data/app/controllers/spree/api/payments_controller.rb +0 -1
  6. data/app/controllers/spree/api/resource_controller.rb +2 -0
  7. data/app/controllers/spree/api/shipments_controller.rb +17 -6
  8. data/app/controllers/spree/api/stock_items_controller.rb +6 -0
  9. data/app/helpers/spree/api/api_helpers.rb +3 -4
  10. data/app/views/.rubocop.yml +4 -0
  11. data/app/views/spree/api/address_books/show.json.jbuilder +11 -0
  12. data/app/views/spree/api/addresses/_address.json.jbuilder +17 -0
  13. data/app/views/spree/api/addresses/show.json.jbuilder +1 -0
  14. data/app/views/spree/api/adjustments/_adjustment.json.jbuilder +4 -0
  15. data/app/views/spree/api/config/money.json.jbuilder +1 -0
  16. data/app/views/spree/api/config/show.json.jbuilder +2 -0
  17. data/app/views/spree/api/countries/index.json.jbuilder +2 -0
  18. data/app/views/spree/api/countries/show.json.jbuilder +4 -0
  19. data/app/views/spree/api/credit_cards/_credit_card.json.jbuilder +10 -0
  20. data/app/views/spree/api/credit_cards/index.json.jbuilder +4 -0
  21. data/app/views/spree/api/credit_cards/show.json.jbuilder +1 -0
  22. data/app/views/spree/api/errors/delete_restriction.json.jbuilder +1 -0
  23. data/app/views/spree/api/errors/gateway_error.json.jbuilder +1 -0
  24. data/app/views/spree/api/errors/invalid_api_key.json.jbuilder +1 -0
  25. data/app/views/spree/api/errors/invalid_resource.json.jbuilder +2 -0
  26. data/app/views/spree/api/errors/must_specify_api_key.json.jbuilder +1 -0
  27. data/app/views/spree/api/errors/not_found.json.jbuilder +1 -0
  28. data/app/views/spree/api/errors/unauthorized.json.jbuilder +1 -0
  29. data/app/views/spree/api/errors/variant_not_in_stock_transfer.json.jbuilder +1 -0
  30. data/app/views/spree/api/images/_image.json.jbuilder +5 -0
  31. data/app/views/spree/api/images/index.json.jbuilder +3 -0
  32. data/app/views/spree/api/images/show.json.jbuilder +1 -0
  33. data/app/views/spree/api/inventory_units/show.json.jbuilder +1 -0
  34. data/app/views/spree/api/line_items/_line_item.json.jbuilder +16 -0
  35. data/app/views/spree/api/line_items/new.json.jbuilder +2 -0
  36. data/app/views/spree/api/line_items/show.json.jbuilder +1 -0
  37. data/app/views/spree/api/option_types/_option_type.json.jbuilder +4 -0
  38. data/app/views/spree/api/option_types/index.json.jbuilder +3 -0
  39. data/app/views/spree/api/option_types/show.json.jbuilder +1 -0
  40. data/app/views/spree/api/option_values/_option_value.json.jbuilder +1 -0
  41. data/app/views/spree/api/option_values/index.json.jbuilder +3 -0
  42. data/app/views/spree/api/option_values/show.json.jbuilder +1 -0
  43. data/app/views/spree/api/orders/_big.json.jbuilder +49 -0
  44. data/app/views/spree/api/orders/_order.json.jbuilder +10 -0
  45. data/app/views/spree/api/orders/could_not_apply_coupon.json.jbuilder +1 -0
  46. data/app/views/spree/api/orders/could_not_transition.json.jbuilder +2 -0
  47. data/app/views/spree/api/orders/expected_total_mismatch.json.jbuilder +1 -0
  48. data/app/views/spree/api/orders/index.json.jbuilder +4 -0
  49. data/app/views/spree/api/orders/invalid_shipping_method.json.jbuilder +1 -0
  50. data/app/views/spree/api/orders/mine.json.jbuilder +4 -0
  51. data/app/views/spree/api/orders/show.json.jbuilder +1 -0
  52. data/app/views/spree/api/payments/credit_over_limit.json.jbuilder +1 -0
  53. data/app/views/spree/api/payments/index.json.jbuilder +2 -0
  54. data/app/views/spree/api/payments/new.json.jbuilder +4 -0
  55. data/app/views/spree/api/payments/show.json.jbuilder +1 -0
  56. data/app/views/spree/api/payments/update_forbidden.json.jbuilder +1 -0
  57. data/app/views/spree/api/product_properties/index.json.jbuilder +4 -0
  58. data/app/views/spree/api/product_properties/new.json.jbuilder +2 -0
  59. data/app/views/spree/api/product_properties/show.json.jbuilder +1 -0
  60. data/app/views/spree/api/products/_product.json.jbuilder +34 -0
  61. data/app/views/spree/api/products/index.json.jbuilder +4 -0
  62. data/app/views/spree/api/products/new.json.jbuilder +2 -0
  63. data/app/views/spree/api/products/show.json.jbuilder +1 -0
  64. data/app/views/spree/api/promotions/handler.json.jbuilder +4 -0
  65. data/app/views/spree/api/promotions/show.json.jbuilder +1 -0
  66. data/app/views/spree/api/properties/index.json.jbuilder +4 -0
  67. data/app/views/spree/api/properties/new.json.jbuilder +2 -0
  68. data/app/views/spree/api/properties/show.json.jbuilder +1 -0
  69. data/app/views/spree/api/return_authorizations/index.json.jbuilder +4 -0
  70. data/app/views/spree/api/return_authorizations/new.json.jbuilder +2 -0
  71. data/app/views/spree/api/return_authorizations/show.json.jbuilder +1 -0
  72. data/app/views/spree/api/shared/_pagination.json.jbuilder +5 -0
  73. data/app/views/spree/api/shipments/_big.json.jbuilder +51 -0
  74. data/app/views/spree/api/shipments/_small.json.jbuilder +32 -0
  75. data/app/views/spree/api/shipments/cannot_ready_shipment.json.jbuilder +1 -0
  76. data/app/views/spree/api/shipments/mine.json.jbuilder +4 -0
  77. data/app/views/spree/api/shipments/show.json.jbuilder +31 -0
  78. data/app/views/spree/api/shipping_rates/_shipping_rate.json.jbuilder +2 -0
  79. data/app/views/spree/api/states/index.json.jbuilder +5 -0
  80. data/app/views/spree/api/states/show.json.jbuilder +1 -0
  81. data/app/views/spree/api/stock_items/_stock_item.json.jbuilder +4 -0
  82. data/app/views/spree/api/stock_items/index.json.jbuilder +4 -0
  83. data/app/views/spree/api/stock_items/show.json.jbuilder +1 -0
  84. data/app/views/spree/api/stock_locations/_stock_location.json.jbuilder +15 -0
  85. data/app/views/spree/api/stock_locations/index.json.jbuilder +4 -0
  86. data/app/views/spree/api/stock_locations/show.json.jbuilder +1 -0
  87. data/app/views/spree/api/stock_movements/_stock_movement.json.jbuilder +4 -0
  88. data/app/views/spree/api/stock_movements/index.json.jbuilder +4 -0
  89. data/app/views/spree/api/stock_movements/show.json.jbuilder +1 -0
  90. data/app/views/spree/api/stock_transfers/receive.json.jbuilder +4 -0
  91. data/app/views/spree/api/store_credit_events/mine.json.jbuilder +5 -0
  92. data/app/views/spree/api/stores/index.json.jbuilder +1 -0
  93. data/app/views/spree/api/stores/show.json.jbuilder +1 -0
  94. data/app/views/spree/api/taxonomies/_nested.json.jbuilder +8 -0
  95. data/app/views/spree/api/taxonomies/_taxonomy.json.jbuilder +11 -0
  96. data/app/views/spree/api/taxonomies/index.json.jbuilder +4 -0
  97. data/app/views/spree/api/taxonomies/jstree.json.jbuilder +6 -0
  98. data/app/views/spree/api/taxonomies/new.json.jbuilder +2 -0
  99. data/app/views/spree/api/taxonomies/show.json.jbuilder +1 -0
  100. data/app/views/spree/api/taxons/_taxon.json.jbuilder +2 -0
  101. data/app/views/spree/api/taxons/_taxons.json.jbuilder +4 -0
  102. data/app/views/spree/api/taxons/index.json.jbuilder +7 -0
  103. data/app/views/spree/api/taxons/jstree.json.jbuilder +8 -0
  104. data/app/views/spree/api/taxons/new.json.jbuilder +2 -0
  105. data/app/views/spree/api/taxons/show.json.jbuilder +1 -0
  106. data/app/views/spree/api/transfer_items/_transfer_item.json.jbuilder +5 -0
  107. data/app/views/spree/api/transfer_items/show.json.jbuilder +1 -0
  108. data/app/views/spree/api/users/_user.json.jbuilder +15 -0
  109. data/app/views/spree/api/users/index.json.jbuilder +4 -0
  110. data/app/views/spree/api/users/new.json.jbuilder +2 -0
  111. data/app/views/spree/api/users/show.json.jbuilder +1 -0
  112. data/app/views/spree/api/variants/_big.json.jbuilder +13 -0
  113. data/app/views/spree/api/variants/_small.json.jbuilder +16 -0
  114. data/app/views/spree/api/variants/index.json.jbuilder +4 -0
  115. data/app/views/spree/api/variants/new.json.jbuilder +2 -0
  116. data/app/views/spree/api/variants/show.json.jbuilder +1 -0
  117. data/app/views/spree/api/zones/_zone.json.jbuilder +4 -0
  118. data/app/views/spree/api/zones/index.json.jbuilder +4 -0
  119. data/app/views/spree/api/zones/show.json.jbuilder +1 -0
  120. data/config/locales/en.yml +1 -0
  121. data/lib/spree/api/engine.rb +0 -14
  122. data/lib/spree/api.rb +1 -1
  123. data/lib/spree_api.rb +1 -0
  124. data/solidus_api.gemspec +3 -1
  125. data/spec/controllers/spree/api/base_controller_spec.rb +0 -56
  126. data/spec/requests/spree/api/checkouts_controller_spec.rb +8 -13
  127. data/spec/requests/spree/api/orders_controller_spec.rb +7 -60
  128. data/spec/requests/spree/api/payments_controller_spec.rb +0 -11
  129. data/spec/requests/spree/api/shipments_controller_spec.rb +16 -1
  130. data/spec/requests/spree/api/states_controller_spec.rb +1 -0
  131. data/spec/requests/spree/api/taxons_controller_spec.rb +25 -0
  132. data/spec/requests/spree/api/users_controller_spec.rb +1 -1
  133. data/spec/support/be_paginated_matcher.rb +7 -0
  134. data/spec/test_views/spree/api/widgets/_widget.json.jbuilder +1 -0
  135. data/spec/test_views/spree/api/widgets/index.json.jbuilder +7 -0
  136. data/spec/test_views/spree/api/widgets/new.json.jbuilder +1 -0
  137. data/spec/test_views/spree/api/widgets/show.json.jbuilder +1 -0
  138. metadata +166 -111
  139. data/app/views/spree/api/address_books/show.v1.rabl +0 -7
  140. data/app/views/spree/api/addresses/show.v1.rabl +0 -10
  141. data/app/views/spree/api/adjustments/show.v1.rabl +0 -4
  142. data/app/views/spree/api/config/money.v1.rabl +0 -2
  143. data/app/views/spree/api/config/show.v1.rabl +0 -3
  144. data/app/views/spree/api/countries/index.v1.rabl +0 -7
  145. data/app/views/spree/api/countries/show.v1.rabl +0 -5
  146. data/app/views/spree/api/credit_cards/index.v1.rabl +0 -7
  147. data/app/views/spree/api/credit_cards/show.v1.rabl +0 -7
  148. data/app/views/spree/api/errors/gateway_error.v1.rabl +0 -2
  149. data/app/views/spree/api/errors/invalid_api_key.v1.rabl +0 -2
  150. data/app/views/spree/api/errors/invalid_resource.v1.rabl +0 -3
  151. data/app/views/spree/api/errors/must_specify_api_key.v1.rabl +0 -2
  152. data/app/views/spree/api/errors/not_found.v1.rabl +0 -2
  153. data/app/views/spree/api/errors/unauthorized.v1.rabl +0 -2
  154. data/app/views/spree/api/errors/variant_not_in_stock_transfer.v1.rabl +0 -2
  155. data/app/views/spree/api/images/index.v1.rabl +0 -4
  156. data/app/views/spree/api/images/show.v1.rabl +0 -6
  157. data/app/views/spree/api/inventory_units/show.rabl +0 -2
  158. data/app/views/spree/api/line_items/new.v1.rabl +0 -3
  159. data/app/views/spree/api/line_items/show.v1.rabl +0 -15
  160. data/app/views/spree/api/option_types/index.v1.rabl +0 -3
  161. data/app/views/spree/api/option_types/show.v1.rabl +0 -5
  162. data/app/views/spree/api/option_values/index.v1.rabl +0 -3
  163. data/app/views/spree/api/option_values/show.v1.rabl +0 -2
  164. data/app/views/spree/api/orders/could_not_apply_coupon.v1.rabl +0 -2
  165. data/app/views/spree/api/orders/could_not_transition.v1.rabl +0 -3
  166. data/app/views/spree/api/orders/expected_total_mismatch.v1.rabl +0 -2
  167. data/app/views/spree/api/orders/index.v1.rabl +0 -7
  168. data/app/views/spree/api/orders/invalid_shipping_method.v1.rabl +0 -2
  169. data/app/views/spree/api/orders/mine.v1.rabl +0 -9
  170. data/app/views/spree/api/orders/order.v1.rabl +0 -9
  171. data/app/views/spree/api/orders/show.v1.rabl +0 -53
  172. data/app/views/spree/api/payments/credit_over_limit.v1.rabl +0 -2
  173. data/app/views/spree/api/payments/index.v1.rabl +0 -7
  174. data/app/views/spree/api/payments/new.v1.rabl +0 -5
  175. data/app/views/spree/api/payments/show.v1.rabl +0 -2
  176. data/app/views/spree/api/payments/update_forbidden.v1.rabl +0 -2
  177. data/app/views/spree/api/product_properties/index.v1.rabl +0 -7
  178. data/app/views/spree/api/product_properties/new.v1.rabl +0 -2
  179. data/app/views/spree/api/product_properties/show.v1.rabl +0 -2
  180. data/app/views/spree/api/products/index.v1.rabl +0 -9
  181. data/app/views/spree/api/products/new.v1.rabl +0 -3
  182. data/app/views/spree/api/products/product.v1.rabl +0 -1
  183. data/app/views/spree/api/products/show.v1.rabl +0 -42
  184. data/app/views/spree/api/promotions/handler.v1.rabl +0 -5
  185. data/app/views/spree/api/promotions/show.v1.rabl +0 -2
  186. data/app/views/spree/api/properties/index.v1.rabl +0 -7
  187. data/app/views/spree/api/properties/new.v1.rabl +0 -2
  188. data/app/views/spree/api/properties/show.v1.rabl +0 -2
  189. data/app/views/spree/api/return_authorizations/index.v1.rabl +0 -7
  190. data/app/views/spree/api/return_authorizations/new.v1.rabl +0 -3
  191. data/app/views/spree/api/return_authorizations/show.v1.rabl +0 -2
  192. data/app/views/spree/api/shipments/big.v1.rabl +0 -55
  193. data/app/views/spree/api/shipments/cannot_ready_shipment.v1.rabl +0 -2
  194. data/app/views/spree/api/shipments/mine.v1.rabl +0 -9
  195. data/app/views/spree/api/shipments/show.v1.rabl +0 -32
  196. data/app/views/spree/api/shipments/small.v1.rabl +0 -37
  197. data/app/views/spree/api/shipping_rates/show.v1.rabl +0 -2
  198. data/app/views/spree/api/states/index.v1.rabl +0 -14
  199. data/app/views/spree/api/states/show.v1.rabl +0 -2
  200. data/app/views/spree/api/stock_items/index.v1.rabl +0 -7
  201. data/app/views/spree/api/stock_items/show.v1.rabl +0 -5
  202. data/app/views/spree/api/stock_locations/index.v1.rabl +0 -7
  203. data/app/views/spree/api/stock_locations/show.v1.rabl +0 -8
  204. data/app/views/spree/api/stock_movements/index.v1.rabl +0 -7
  205. data/app/views/spree/api/stock_movements/show.v1.rabl +0 -5
  206. data/app/views/spree/api/stock_transfers/receive.v1.rabl +0 -5
  207. data/app/views/spree/api/store_credit_events/mine.v1.rabl +0 -10
  208. data/app/views/spree/api/stores/index.v1.rabl +0 -4
  209. data/app/views/spree/api/stores/show.v1.rabl +0 -2
  210. data/app/views/spree/api/taxonomies/index.v1.rabl +0 -7
  211. data/app/views/spree/api/taxonomies/jstree.rabl +0 -8
  212. data/app/views/spree/api/taxonomies/nested.v1.rabl +0 -11
  213. data/app/views/spree/api/taxonomies/new.v1.rabl +0 -3
  214. data/app/views/spree/api/taxonomies/show.v1.rabl +0 -15
  215. data/app/views/spree/api/taxons/index.v1.rabl +0 -12
  216. data/app/views/spree/api/taxons/jstree.rabl +0 -8
  217. data/app/views/spree/api/taxons/new.v1.rabl +0 -3
  218. data/app/views/spree/api/taxons/show.v1.rabl +0 -6
  219. data/app/views/spree/api/taxons/taxons.v1.rabl +0 -5
  220. data/app/views/spree/api/transfer_items/show.v1.rabl +0 -6
  221. data/app/views/spree/api/users/index.v1.rabl +0 -7
  222. data/app/views/spree/api/users/new.v1.rabl +0 -3
  223. data/app/views/spree/api/users/show.v1.rabl +0 -10
  224. data/app/views/spree/api/variants/big.v1.rabl +0 -20
  225. data/app/views/spree/api/variants/index.v1.rabl +0 -9
  226. data/app/views/spree/api/variants/new.v1.rabl +0 -2
  227. data/app/views/spree/api/variants/show.v1.rabl +0 -3
  228. data/app/views/spree/api/variants/small.v1.rabl +0 -17
  229. data/app/views/spree/api/zones/index.v1.rabl +0 -7
  230. data/app/views/spree/api/zones/show.v1.rabl +0 -6
  231. data/config/initializers/rails5_rabl_hacks.rb +0 -12
  232. data/spec/test_views/spree/api/widgets/index.v1.rabl +0 -7
  233. data/spec/test_views/spree/api/widgets/new.v1.rabl +0 -2
  234. data/spec/test_views/spree/api/widgets/show.v1.rabl +0 -2
@@ -31,10 +31,9 @@ module Spree
31
31
  describe "POST create" do
32
32
  let(:target_user) { create :user }
33
33
  let(:date_override) { Time.parse('2015-01-01') }
34
- let(:attributes) { { user_id: target_user.id, created_at: date_override, email: target_user.email } }
35
34
 
36
35
  subject do
37
- post spree.api_orders_path, params: { order: attributes }
36
+ post spree.api_orders_path, params: { order: { user_id: target_user.id, created_at: date_override, email: target_user.email } }
38
37
  response
39
38
  end
40
39
 
@@ -45,37 +44,12 @@ module Spree
45
44
 
46
45
  it "does not include unpermitted params, or allow overriding the user" do
47
46
  subject
48
- expect(response).to be_success
49
47
  order = Spree::Order.last
50
48
  expect(order.user).to eq current_api_user
51
49
  expect(order.email).to eq target_user.email
52
50
  end
53
51
 
54
52
  it { is_expected.to be_success }
55
-
56
- context 'creating payment' do
57
- let(:attributes) { super().merge(payments_attributes: [{ payment_method_id: payment_method.id }]) }
58
-
59
- context "with allowed payment method" do
60
- let!(:payment_method) { create(:check_payment_method, name: "allowed" ) }
61
- it { is_expected.to be_success }
62
- it "creates a payment" do
63
- expect {
64
- subject
65
- }.to change { Spree::Payment.count }.by(1)
66
- end
67
- end
68
-
69
- context "with disallowed payment method" do
70
- let!(:payment_method) { create(:check_payment_method, name: "forbidden", available_to_users: false) }
71
- it { is_expected.to be_not_found }
72
- it "creates no payments" do
73
- expect {
74
- subject
75
- }.not_to change { Spree::Payment.count }
76
- end
77
- end
78
- end
79
53
  end
80
54
 
81
55
  context "when the current user can administrate the order" do
@@ -95,7 +69,7 @@ module Spree
95
69
  end
96
70
 
97
71
  context 'when the line items have custom attributes' do
98
- it "can create an order with line items that have custom permitted attributes", :pending do
72
+ it "can create an order with line items that have custom permitted attributes" do
99
73
  PermittedAttributes.line_item_attributes << { options: [:some_option] }
100
74
  expect_any_instance_of(Spree::LineItem).to receive(:some_option=).once.with('4')
101
75
  post spree.api_orders_path, params: { order: { line_items: { "0" => { variant_id: variant.to_param, quantity: 5, options: { some_option: 4 } } } } }
@@ -139,30 +113,6 @@ module Spree
139
113
  subject
140
114
  }.to_not change{ order.reload.number }
141
115
  end
142
-
143
- context 'creating payment' do
144
- let(:order_params) { super().merge(payments_attributes: [{ payment_method_id: payment_method.id }]) }
145
-
146
- context "with allowed payment method" do
147
- let!(:payment_method) { create(:check_payment_method, name: "allowed" ) }
148
- it { is_expected.to be_success }
149
- it "creates a payment" do
150
- expect {
151
- subject
152
- }.to change { Spree::Payment.count }.by(1)
153
- end
154
- end
155
-
156
- context "with disallowed payment method" do
157
- let!(:payment_method) { create(:check_payment_method, name: "forbidden", available_to_users: false) }
158
- it { is_expected.to be_not_found }
159
- it "creates no payments" do
160
- expect {
161
- subject
162
- }.not_to change { Spree::Payment.count }
163
- end
164
- end
165
- end
166
116
  end
167
117
 
168
118
  context "when the user can administer the order" do
@@ -327,13 +277,6 @@ module Spree
327
277
  expect(json_response["checkout_steps"]).to eq(%w[address delivery confirm complete])
328
278
  end
329
279
 
330
- # Regression test for https://github.com/spree/spree/issues/1992
331
- it "can view an order not in a standard state" do
332
- allow_any_instance_of(Order).to receive_messages user: current_api_user
333
- order.update_column(:state, 'shipped')
334
- get spree.api_order_path(order)
335
- end
336
-
337
280
  it "can not view someone else's order" do
338
281
  allow_any_instance_of(Order).to receive_messages user: stub_model(Spree::LegacyUser)
339
282
  get spree.api_order_path(order)
@@ -394,7 +337,10 @@ module Spree
394
337
 
395
338
  # Regression test for https://github.com/spree/spree/issues/3404
396
339
  it "can specify additional parameters for a line item" do
397
- expect_any_instance_of(Spree::LineItem).to receive(:special=).with("foo")
340
+ expect(Order).to receive(:create!).and_return(order = Spree::Order.new)
341
+ allow(order).to receive(:associate_user!)
342
+ allow(order).to receive_message_chain(:contents, :add).and_return(line_item = double('LineItem'))
343
+ expect(line_item).to receive(:update_attributes!).with(hash_including("special" => "foo"))
398
344
 
399
345
  allow_any_instance_of(Spree::Api::OrdersController).to receive_messages(permitted_line_item_attributes: [:id, :variant_id, :quantity, :special])
400
346
  post spree.api_orders_path, params: {
@@ -560,6 +506,7 @@ module Spree
560
506
 
561
507
  context "with a line item" do
562
508
  let(:order) { create(:order_with_line_items) }
509
+ let(:line_item) { order.line_items.first }
563
510
 
564
511
  it "can empty an order" do
565
512
  create(:adjustment, order: order, adjustable: order)
@@ -42,17 +42,6 @@ module Spree
42
42
  expect(response.status).to eq(201)
43
43
  expect(json_response).to have_attributes(attributes)
44
44
  end
45
-
46
- context "disallowed payment method" do
47
- it "does not create a new payment" do
48
- PaymentMethod.first.update!(available_to_users: false)
49
-
50
- expect {
51
- post spree.api_order_payments_path(order), params: { payment: { payment_method_id: PaymentMethod.first.id, amount: 50 } }
52
- }.not_to change { Spree::Payment.count }
53
- expect(response.status).to eq(404)
54
- end
55
- end
56
45
  end
57
46
 
58
47
  context "payment source is required" do
@@ -354,6 +354,21 @@ describe Spree::Api::ShipmentsController, type: :request do
354
354
  end
355
355
  end
356
356
 
357
+ context "for an unsuccessful transfer" do
358
+ before do
359
+ source_shipment
360
+ variant
361
+ stock_location.stock_items.update_all(backorderable: false)
362
+ end
363
+
364
+ it "returns the correct message" do
365
+ subject
366
+ expect(response).to be_accepted
367
+ expect(parsed_response["success"]).to be false
368
+ expect(parsed_response["message"]).to eq("Desired shipment not enough stock in desired stock location")
369
+ end
370
+ end
371
+
357
372
  context "if the source shipment can not be found" do
358
373
  let(:stock_location_id) { 9999 }
359
374
 
@@ -422,7 +437,7 @@ describe Spree::Api::ShipmentsController, type: :request do
422
437
 
423
438
  it "returns the correct message" do
424
439
  subject
425
- expect(response).to be_success
440
+ expect(response).to be_accepted
426
441
  expect(parsed_response["success"]).to be true
427
442
  expect(parsed_response["message"]).to eq("Variants successfully transferred")
428
443
  end
@@ -27,6 +27,7 @@ module Spree
27
27
  create(:state)
28
28
  get spree.api_states_path, params: { page: 2, per_page: 1 }
29
29
 
30
+ expect(json_response).to be_paginated
30
31
  expect(json_response["states"].size).to eq(1)
31
32
  expect(json_response["pages"]).to eq(2)
32
33
  expect(json_response["current_page"]).to eq(2)
@@ -120,6 +120,31 @@ module Spree
120
120
  delete spree.api_taxonomy_taxon_path(taxonomy, taxon.id)
121
121
  assert_unauthorized!
122
122
  end
123
+
124
+ context "with caching enabled" do
125
+ let!(:product) { create(:product, taxons: [taxon]) }
126
+
127
+ before do
128
+ ActionController::Base.perform_caching = true
129
+ end
130
+
131
+ it "handles exclude_data correctly" do
132
+ get spree.api_taxon_products_path, params: { id: taxon.id, simple: true }
133
+ expect(response).to be_success
134
+ simple_response = json_response
135
+
136
+ get spree.api_taxon_products_path, params: { id: taxon.id }
137
+ expect(response).to be_success
138
+ full_response = json_response
139
+
140
+ expect(simple_response["products"][0]["description"]).to be_nil
141
+ expect(full_response["products"][0]["description"]).not_to be_nil
142
+ end
143
+
144
+ after do
145
+ ActionController::Base.perform_caching = false
146
+ end
147
+ end
123
148
  end
124
149
 
125
150
  context "as an admin" do
@@ -142,8 +142,8 @@ module Spree
142
142
  it "cannot destroy user with orders" do
143
143
  create(:completed_order_with_totals, user: user)
144
144
  delete spree.api_user_path(user)
145
- expect(json_response["exception"]).to eq "Spree::Core::DestroyWithOrdersError"
146
145
  expect(response.status).to eq(422)
146
+ expect(json_response).to eq({ "error" => "Cannot delete record." })
147
147
  end
148
148
  end
149
149
  end
@@ -0,0 +1,7 @@
1
+ RSpec::Matchers.define :be_paginated do
2
+ match do |actual|
3
+ %w[count total_count current_page pages per_page].all? do |attr|
4
+ actual[attr].is_a?(Integer)
5
+ end
6
+ end
7
+ end
@@ -0,0 +1 @@
1
+ json.(widget, :id, :name, :position)
@@ -0,0 +1,7 @@
1
+
2
+ json.widgets(@collection) do |widget|
3
+ json.partial!("spree/api/widgets/widget", widget: widget)
4
+ end
5
+ json.count @collection.count
6
+ json.current_page (params[:page] or 1)
7
+ json.pages @collection.total_pages
@@ -0,0 +1 @@
1
+ json.attributes [:name]
@@ -0,0 +1 @@
1
+ json.partial!("spree/api/widgets/widget", widget: @object)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.4.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-12 00:00:00.000000000 Z
11
+ date: 2017-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus_core
@@ -16,42 +16,76 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.3.1
19
+ version: 2.4.0.beta1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.3.1
26
+ version: 2.4.0.beta1
27
27
  - !ruby/object:Gem::Dependency
28
- name: rabl
28
+ name: versioncake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '='
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.13.0
33
+ version: '3.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '='
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.13.0
40
+ version: '3.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: versioncake
42
+ name: responders
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: jbuilder
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
59
  - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: '3.0'
61
+ version: '2.6'
48
62
  type: :runtime
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
66
  - - "~>"
53
67
  - !ruby/object:Gem::Version
54
- version: '3.0'
68
+ version: '2.6'
69
+ - !ruby/object:Gem::Dependency
70
+ name: kaminari
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0.17'
76
+ - - "<"
77
+ - !ruby/object:Gem::Version
78
+ version: '2.0'
79
+ type: :runtime
80
+ prerelease: false
81
+ version_requirements: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0.17'
86
+ - - "<"
87
+ - !ruby/object:Gem::Version
88
+ version: '2.0'
55
89
  description: REST API for the Solidus e-commerce framework.
56
90
  email: contact@solidus.io
57
91
  executables: []
@@ -100,99 +134,116 @@ files:
100
134
  - app/controllers/spree/api/zones_controller.rb
101
135
  - app/helpers/spree/api/api_helpers.rb
102
136
  - app/models/spree/api_configuration.rb
103
- - app/views/spree/api/address_books/show.v1.rabl
104
- - app/views/spree/api/addresses/show.v1.rabl
105
- - app/views/spree/api/adjustments/show.v1.rabl
106
- - app/views/spree/api/config/money.v1.rabl
107
- - app/views/spree/api/config/show.v1.rabl
108
- - app/views/spree/api/countries/index.v1.rabl
109
- - app/views/spree/api/countries/show.v1.rabl
110
- - app/views/spree/api/credit_cards/index.v1.rabl
111
- - app/views/spree/api/credit_cards/show.v1.rabl
112
- - app/views/spree/api/errors/gateway_error.v1.rabl
113
- - app/views/spree/api/errors/invalid_api_key.v1.rabl
114
- - app/views/spree/api/errors/invalid_resource.v1.rabl
115
- - app/views/spree/api/errors/must_specify_api_key.v1.rabl
116
- - app/views/spree/api/errors/not_found.v1.rabl
117
- - app/views/spree/api/errors/unauthorized.v1.rabl
118
- - app/views/spree/api/errors/variant_not_in_stock_transfer.v1.rabl
119
- - app/views/spree/api/images/index.v1.rabl
120
- - app/views/spree/api/images/show.v1.rabl
121
- - app/views/spree/api/inventory_units/show.rabl
122
- - app/views/spree/api/line_items/new.v1.rabl
123
- - app/views/spree/api/line_items/show.v1.rabl
124
- - app/views/spree/api/option_types/index.v1.rabl
125
- - app/views/spree/api/option_types/show.v1.rabl
126
- - app/views/spree/api/option_values/index.v1.rabl
127
- - app/views/spree/api/option_values/show.v1.rabl
128
- - app/views/spree/api/orders/could_not_apply_coupon.v1.rabl
129
- - app/views/spree/api/orders/could_not_transition.v1.rabl
130
- - app/views/spree/api/orders/expected_total_mismatch.v1.rabl
131
- - app/views/spree/api/orders/index.v1.rabl
132
- - app/views/spree/api/orders/invalid_shipping_method.v1.rabl
133
- - app/views/spree/api/orders/mine.v1.rabl
134
- - app/views/spree/api/orders/order.v1.rabl
135
- - app/views/spree/api/orders/show.v1.rabl
136
- - app/views/spree/api/payments/credit_over_limit.v1.rabl
137
- - app/views/spree/api/payments/index.v1.rabl
138
- - app/views/spree/api/payments/new.v1.rabl
139
- - app/views/spree/api/payments/show.v1.rabl
140
- - app/views/spree/api/payments/update_forbidden.v1.rabl
141
- - app/views/spree/api/product_properties/index.v1.rabl
142
- - app/views/spree/api/product_properties/new.v1.rabl
143
- - app/views/spree/api/product_properties/show.v1.rabl
144
- - app/views/spree/api/products/index.v1.rabl
145
- - app/views/spree/api/products/new.v1.rabl
146
- - app/views/spree/api/products/product.v1.rabl
147
- - app/views/spree/api/products/show.v1.rabl
148
- - app/views/spree/api/promotions/handler.v1.rabl
149
- - app/views/spree/api/promotions/show.v1.rabl
150
- - app/views/spree/api/properties/index.v1.rabl
151
- - app/views/spree/api/properties/new.v1.rabl
152
- - app/views/spree/api/properties/show.v1.rabl
153
- - app/views/spree/api/return_authorizations/index.v1.rabl
154
- - app/views/spree/api/return_authorizations/new.v1.rabl
155
- - app/views/spree/api/return_authorizations/show.v1.rabl
156
- - app/views/spree/api/shipments/big.v1.rabl
157
- - app/views/spree/api/shipments/cannot_ready_shipment.v1.rabl
158
- - app/views/spree/api/shipments/mine.v1.rabl
159
- - app/views/spree/api/shipments/show.v1.rabl
160
- - app/views/spree/api/shipments/small.v1.rabl
161
- - app/views/spree/api/shipping_rates/show.v1.rabl
162
- - app/views/spree/api/states/index.v1.rabl
163
- - app/views/spree/api/states/show.v1.rabl
164
- - app/views/spree/api/stock_items/index.v1.rabl
165
- - app/views/spree/api/stock_items/show.v1.rabl
166
- - app/views/spree/api/stock_locations/index.v1.rabl
167
- - app/views/spree/api/stock_locations/show.v1.rabl
168
- - app/views/spree/api/stock_movements/index.v1.rabl
169
- - app/views/spree/api/stock_movements/show.v1.rabl
170
- - app/views/spree/api/stock_transfers/receive.v1.rabl
171
- - app/views/spree/api/store_credit_events/mine.v1.rabl
172
- - app/views/spree/api/stores/index.v1.rabl
173
- - app/views/spree/api/stores/show.v1.rabl
174
- - app/views/spree/api/taxonomies/index.v1.rabl
175
- - app/views/spree/api/taxonomies/jstree.rabl
176
- - app/views/spree/api/taxonomies/nested.v1.rabl
177
- - app/views/spree/api/taxonomies/new.v1.rabl
178
- - app/views/spree/api/taxonomies/show.v1.rabl
179
- - app/views/spree/api/taxons/index.v1.rabl
180
- - app/views/spree/api/taxons/jstree.rabl
181
- - app/views/spree/api/taxons/new.v1.rabl
182
- - app/views/spree/api/taxons/show.v1.rabl
183
- - app/views/spree/api/taxons/taxons.v1.rabl
184
- - app/views/spree/api/transfer_items/show.v1.rabl
185
- - app/views/spree/api/users/index.v1.rabl
186
- - app/views/spree/api/users/new.v1.rabl
187
- - app/views/spree/api/users/show.v1.rabl
188
- - app/views/spree/api/variants/big.v1.rabl
189
- - app/views/spree/api/variants/index.v1.rabl
190
- - app/views/spree/api/variants/new.v1.rabl
191
- - app/views/spree/api/variants/show.v1.rabl
192
- - app/views/spree/api/variants/small.v1.rabl
193
- - app/views/spree/api/zones/index.v1.rabl
194
- - app/views/spree/api/zones/show.v1.rabl
195
- - config/initializers/rails5_rabl_hacks.rb
137
+ - app/views/.rubocop.yml
138
+ - app/views/spree/api/address_books/show.json.jbuilder
139
+ - app/views/spree/api/addresses/_address.json.jbuilder
140
+ - app/views/spree/api/addresses/show.json.jbuilder
141
+ - app/views/spree/api/adjustments/_adjustment.json.jbuilder
142
+ - app/views/spree/api/config/money.json.jbuilder
143
+ - app/views/spree/api/config/show.json.jbuilder
144
+ - app/views/spree/api/countries/index.json.jbuilder
145
+ - app/views/spree/api/countries/show.json.jbuilder
146
+ - app/views/spree/api/credit_cards/_credit_card.json.jbuilder
147
+ - app/views/spree/api/credit_cards/index.json.jbuilder
148
+ - app/views/spree/api/credit_cards/show.json.jbuilder
149
+ - app/views/spree/api/errors/delete_restriction.json.jbuilder
150
+ - app/views/spree/api/errors/gateway_error.json.jbuilder
151
+ - app/views/spree/api/errors/invalid_api_key.json.jbuilder
152
+ - app/views/spree/api/errors/invalid_resource.json.jbuilder
153
+ - app/views/spree/api/errors/must_specify_api_key.json.jbuilder
154
+ - app/views/spree/api/errors/not_found.json.jbuilder
155
+ - app/views/spree/api/errors/unauthorized.json.jbuilder
156
+ - app/views/spree/api/errors/variant_not_in_stock_transfer.json.jbuilder
157
+ - app/views/spree/api/images/_image.json.jbuilder
158
+ - app/views/spree/api/images/index.json.jbuilder
159
+ - app/views/spree/api/images/show.json.jbuilder
160
+ - app/views/spree/api/inventory_units/show.json.jbuilder
161
+ - app/views/spree/api/line_items/_line_item.json.jbuilder
162
+ - app/views/spree/api/line_items/new.json.jbuilder
163
+ - app/views/spree/api/line_items/show.json.jbuilder
164
+ - app/views/spree/api/option_types/_option_type.json.jbuilder
165
+ - app/views/spree/api/option_types/index.json.jbuilder
166
+ - app/views/spree/api/option_types/show.json.jbuilder
167
+ - app/views/spree/api/option_values/_option_value.json.jbuilder
168
+ - app/views/spree/api/option_values/index.json.jbuilder
169
+ - app/views/spree/api/option_values/show.json.jbuilder
170
+ - app/views/spree/api/orders/_big.json.jbuilder
171
+ - app/views/spree/api/orders/_order.json.jbuilder
172
+ - app/views/spree/api/orders/could_not_apply_coupon.json.jbuilder
173
+ - app/views/spree/api/orders/could_not_transition.json.jbuilder
174
+ - app/views/spree/api/orders/expected_total_mismatch.json.jbuilder
175
+ - app/views/spree/api/orders/index.json.jbuilder
176
+ - app/views/spree/api/orders/invalid_shipping_method.json.jbuilder
177
+ - app/views/spree/api/orders/mine.json.jbuilder
178
+ - app/views/spree/api/orders/show.json.jbuilder
179
+ - app/views/spree/api/payments/credit_over_limit.json.jbuilder
180
+ - app/views/spree/api/payments/index.json.jbuilder
181
+ - app/views/spree/api/payments/new.json.jbuilder
182
+ - app/views/spree/api/payments/show.json.jbuilder
183
+ - app/views/spree/api/payments/update_forbidden.json.jbuilder
184
+ - app/views/spree/api/product_properties/index.json.jbuilder
185
+ - app/views/spree/api/product_properties/new.json.jbuilder
186
+ - app/views/spree/api/product_properties/show.json.jbuilder
187
+ - app/views/spree/api/products/_product.json.jbuilder
188
+ - app/views/spree/api/products/index.json.jbuilder
189
+ - app/views/spree/api/products/new.json.jbuilder
190
+ - app/views/spree/api/products/show.json.jbuilder
191
+ - app/views/spree/api/promotions/handler.json.jbuilder
192
+ - app/views/spree/api/promotions/show.json.jbuilder
193
+ - app/views/spree/api/properties/index.json.jbuilder
194
+ - app/views/spree/api/properties/new.json.jbuilder
195
+ - app/views/spree/api/properties/show.json.jbuilder
196
+ - app/views/spree/api/return_authorizations/index.json.jbuilder
197
+ - app/views/spree/api/return_authorizations/new.json.jbuilder
198
+ - app/views/spree/api/return_authorizations/show.json.jbuilder
199
+ - app/views/spree/api/shared/_pagination.json.jbuilder
200
+ - app/views/spree/api/shipments/_big.json.jbuilder
201
+ - app/views/spree/api/shipments/_small.json.jbuilder
202
+ - app/views/spree/api/shipments/cannot_ready_shipment.json.jbuilder
203
+ - app/views/spree/api/shipments/mine.json.jbuilder
204
+ - app/views/spree/api/shipments/show.json.jbuilder
205
+ - app/views/spree/api/shipping_rates/_shipping_rate.json.jbuilder
206
+ - app/views/spree/api/states/index.json.jbuilder
207
+ - app/views/spree/api/states/show.json.jbuilder
208
+ - app/views/spree/api/stock_items/_stock_item.json.jbuilder
209
+ - app/views/spree/api/stock_items/index.json.jbuilder
210
+ - app/views/spree/api/stock_items/show.json.jbuilder
211
+ - app/views/spree/api/stock_locations/_stock_location.json.jbuilder
212
+ - app/views/spree/api/stock_locations/index.json.jbuilder
213
+ - app/views/spree/api/stock_locations/show.json.jbuilder
214
+ - app/views/spree/api/stock_movements/_stock_movement.json.jbuilder
215
+ - app/views/spree/api/stock_movements/index.json.jbuilder
216
+ - app/views/spree/api/stock_movements/show.json.jbuilder
217
+ - app/views/spree/api/stock_transfers/receive.json.jbuilder
218
+ - app/views/spree/api/store_credit_events/mine.json.jbuilder
219
+ - app/views/spree/api/stores/index.json.jbuilder
220
+ - app/views/spree/api/stores/show.json.jbuilder
221
+ - app/views/spree/api/taxonomies/_nested.json.jbuilder
222
+ - app/views/spree/api/taxonomies/_taxonomy.json.jbuilder
223
+ - app/views/spree/api/taxonomies/index.json.jbuilder
224
+ - app/views/spree/api/taxonomies/jstree.json.jbuilder
225
+ - app/views/spree/api/taxonomies/new.json.jbuilder
226
+ - app/views/spree/api/taxonomies/show.json.jbuilder
227
+ - app/views/spree/api/taxons/_taxon.json.jbuilder
228
+ - app/views/spree/api/taxons/_taxons.json.jbuilder
229
+ - app/views/spree/api/taxons/index.json.jbuilder
230
+ - app/views/spree/api/taxons/jstree.json.jbuilder
231
+ - app/views/spree/api/taxons/new.json.jbuilder
232
+ - app/views/spree/api/taxons/show.json.jbuilder
233
+ - app/views/spree/api/transfer_items/_transfer_item.json.jbuilder
234
+ - app/views/spree/api/transfer_items/show.json.jbuilder
235
+ - app/views/spree/api/users/_user.json.jbuilder
236
+ - app/views/spree/api/users/index.json.jbuilder
237
+ - app/views/spree/api/users/new.json.jbuilder
238
+ - app/views/spree/api/users/show.json.jbuilder
239
+ - app/views/spree/api/variants/_big.json.jbuilder
240
+ - app/views/spree/api/variants/_small.json.jbuilder
241
+ - app/views/spree/api/variants/index.json.jbuilder
242
+ - app/views/spree/api/variants/new.json.jbuilder
243
+ - app/views/spree/api/variants/show.json.jbuilder
244
+ - app/views/spree/api/zones/_zone.json.jbuilder
245
+ - app/views/spree/api/zones/index.json.jbuilder
246
+ - app/views/spree/api/zones/show.json.jbuilder
196
247
  - config/locales/en.yml
197
248
  - config/routes.rb
198
249
  - db/migrate/20100107141738_add_api_key_to_spree_users.rb
@@ -254,12 +305,14 @@ files:
254
305
  - spec/requests/spree/api/zones_controller_spec.rb
255
306
  - spec/shared_examples/protect_product_actions.rb
256
307
  - spec/spec_helper.rb
308
+ - spec/support/be_paginated_matcher.rb
257
309
  - spec/support/controller_hacks.rb
258
310
  - spec/support/database_cleaner.rb
259
311
  - spec/support/have_attributes_matcher.rb
260
- - spec/test_views/spree/api/widgets/index.v1.rabl
261
- - spec/test_views/spree/api/widgets/new.v1.rabl
262
- - spec/test_views/spree/api/widgets/show.v1.rabl
312
+ - spec/test_views/spree/api/widgets/_widget.json.jbuilder
313
+ - spec/test_views/spree/api/widgets/index.json.jbuilder
314
+ - spec/test_views/spree/api/widgets/new.json.jbuilder
315
+ - spec/test_views/spree/api/widgets/show.json.jbuilder
263
316
  homepage: http://solidus.io/
264
317
  licenses:
265
318
  - BSD-3-Clause
@@ -329,9 +382,11 @@ test_files:
329
382
  - spec/requests/spree/api/zones_controller_spec.rb
330
383
  - spec/shared_examples/protect_product_actions.rb
331
384
  - spec/spec_helper.rb
385
+ - spec/support/be_paginated_matcher.rb
332
386
  - spec/support/controller_hacks.rb
333
387
  - spec/support/database_cleaner.rb
334
388
  - spec/support/have_attributes_matcher.rb
335
- - spec/test_views/spree/api/widgets/index.v1.rabl
336
- - spec/test_views/spree/api/widgets/new.v1.rabl
337
- - spec/test_views/spree/api/widgets/show.v1.rabl
389
+ - spec/test_views/spree/api/widgets/_widget.json.jbuilder
390
+ - spec/test_views/spree/api/widgets/index.json.jbuilder
391
+ - spec/test_views/spree/api/widgets/new.json.jbuilder
392
+ - spec/test_views/spree/api/widgets/show.json.jbuilder
@@ -1,7 +0,0 @@
1
- collection @user_addresses
2
- node do |user_address|
3
- partial("spree/api/addresses/show", object: user_address.address).merge(
4
- default: user_address.default,
5
- update_target: @address == user_address.address,
6
- )
7
- end
@@ -1,10 +0,0 @@
1
- object @address
2
- cache [I18n.locale, root_object]
3
- attributes *address_attributes
4
-
5
- child(:country) do |address|
6
- attributes *country_attributes
7
- end
8
- child(:state) do |address|
9
- attributes *state_attributes
10
- end
@@ -1,4 +0,0 @@
1
- object @adjustment
2
- cache [I18n.locale, root_object]
3
- attributes *adjustment_attributes
4
- node(:display_amount) { |a| a.display_amount.to_s }
@@ -1,2 +0,0 @@
1
- object false
2
- node(:symbol) { ::Money.new(1, Spree::Config[:currency]).symbol }