spree_api 3.0.10 → 3.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (190) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/spree/api/base_controller.rb +21 -22
  3. data/app/controllers/spree/api/v1/addresses_controller.rb +46 -0
  4. data/app/controllers/spree/api/v1/checkouts_controller.rb +103 -0
  5. data/app/controllers/spree/api/v1/classifications_controller.rb +20 -0
  6. data/app/controllers/spree/api/v1/countries_controller.rb +24 -0
  7. data/app/controllers/spree/api/v1/credit_cards_controller.rb +27 -0
  8. data/app/controllers/spree/api/v1/images_controller.rb +56 -0
  9. data/app/controllers/spree/api/v1/inventory_units_controller.rb +54 -0
  10. data/app/controllers/spree/api/v1/line_items_controller.rb +70 -0
  11. data/app/controllers/spree/api/v1/option_types_controller.rb +51 -0
  12. data/app/controllers/spree/api/v1/option_values_controller.rb +60 -0
  13. data/app/controllers/spree/api/v1/orders_controller.rb +137 -0
  14. data/app/controllers/spree/api/v1/payments_controller.rb +82 -0
  15. data/app/controllers/spree/api/v1/product_properties_controller.rb +73 -0
  16. data/app/controllers/spree/api/v1/products_controller.rb +126 -0
  17. data/app/controllers/spree/api/v1/promotions_controller.rb +28 -0
  18. data/app/controllers/spree/api/v1/properties_controller.rb +72 -0
  19. data/app/controllers/spree/api/v1/return_authorizations_controller.rb +71 -0
  20. data/app/controllers/spree/api/v1/shipments_controller.rb +163 -0
  21. data/app/controllers/spree/api/v1/states_controller.rb +37 -0
  22. data/app/controllers/spree/api/v1/stock_items_controller.rb +77 -0
  23. data/app/controllers/spree/api/v1/stock_locations_controller.rb +52 -0
  24. data/app/controllers/spree/api/v1/stock_movements_controller.rb +45 -0
  25. data/app/controllers/spree/api/v1/stores_controller.rb +57 -0
  26. data/app/controllers/spree/api/v1/taxonomies_controller.rb +66 -0
  27. data/app/controllers/spree/api/v1/taxons_controller.rb +95 -0
  28. data/app/controllers/spree/api/v1/users_controller.rb +60 -0
  29. data/app/controllers/spree/api/v1/variants_controller.rb +75 -0
  30. data/app/controllers/spree/api/v1/zones_controller.rb +51 -0
  31. data/app/helpers/spree/api/api_helpers.rb +3 -2
  32. data/app/views/spree/api/{addresses → v1/addresses}/show.v1.rabl +0 -0
  33. data/app/views/spree/api/{adjustments → v1/adjustments}/show.v1.rabl +0 -0
  34. data/app/views/spree/api/{config → v1/config}/money.v1.rabl +0 -0
  35. data/app/views/spree/api/{config → v1/config}/show.v1.rabl +0 -0
  36. data/app/views/spree/api/{countries → v1/countries}/index.v1.rabl +0 -0
  37. data/app/views/spree/api/{countries → v1/countries}/show.v1.rabl +0 -0
  38. data/app/views/spree/api/{credit_cards → v1/credit_cards}/index.v1.rabl +1 -1
  39. data/app/views/spree/api/{credit_cards → v1/credit_cards}/show.v1.rabl +0 -0
  40. data/app/views/spree/api/{images → v1/images}/index.v1.rabl +1 -1
  41. data/app/views/spree/api/v1/images/new.v1.rabl +3 -0
  42. data/app/views/spree/api/{images → v1/images}/show.v1.rabl +0 -0
  43. data/app/views/spree/api/{inventory_units → v1/inventory_units}/show.rabl +0 -0
  44. data/app/views/spree/api/{line_items → v1/line_items}/new.v1.rabl +0 -0
  45. data/app/views/spree/api/{line_items → v1/line_items}/show.v1.rabl +3 -3
  46. data/app/views/spree/api/v1/option_types/index.v1.rabl +3 -0
  47. data/app/views/spree/api/v1/option_types/new.v1.rabl +3 -0
  48. data/app/views/spree/api/{option_types → v1/option_types}/show.v1.rabl +0 -0
  49. data/app/views/spree/api/v1/option_values/index.v1.rabl +3 -0
  50. data/app/views/spree/api/v1/option_values/new.v1.rabl +3 -0
  51. data/app/views/spree/api/{option_values → v1/option_values}/show.v1.rabl +0 -0
  52. data/app/views/spree/api/{orders → v1/orders}/address.v1.rabl +0 -0
  53. data/app/views/spree/api/{orders → v1/orders}/canceled.v1.rabl +0 -0
  54. data/app/views/spree/api/{orders → v1/orders}/cart.v1.rabl +0 -0
  55. data/app/views/spree/api/{orders → v1/orders}/complete.v1.rabl +0 -0
  56. data/app/views/spree/api/{orders → v1/orders}/could_not_apply_coupon.v1.rabl +0 -0
  57. data/app/views/spree/api/{orders → v1/orders}/could_not_transition.v1.rabl +0 -0
  58. data/app/views/spree/api/{orders → v1/orders}/index.v1.rabl +1 -1
  59. data/app/views/spree/api/{orders → v1/orders}/invalid_shipping_method.v1.rabl +0 -0
  60. data/app/views/spree/api/{orders → v1/orders}/mine.v1.rabl +1 -1
  61. data/app/views/spree/api/{orders → v1/orders}/order.v1.rabl +1 -0
  62. data/app/views/spree/api/{orders → v1/orders}/payment.v1.rabl +0 -0
  63. data/app/views/spree/api/{orders → v1/orders}/show.v1.rabl +9 -9
  64. data/app/views/spree/api/{payments → v1/payments}/credit_over_limit.v1.rabl +0 -0
  65. data/app/views/spree/api/{payments → v1/payments}/index.v1.rabl +0 -0
  66. data/app/views/spree/api/{payments → v1/payments}/new.v1.rabl +0 -0
  67. data/app/views/spree/api/{payments → v1/payments}/show.v1.rabl +0 -0
  68. data/app/views/spree/api/{payments → v1/payments}/update_forbidden.v1.rabl +0 -0
  69. data/app/views/spree/api/{product_properties → v1/product_properties}/index.v1.rabl +0 -0
  70. data/app/views/spree/api/{product_properties → v1/product_properties}/new.v1.rabl +0 -0
  71. data/app/views/spree/api/{product_properties → v1/product_properties}/show.v1.rabl +0 -0
  72. data/app/views/spree/api/{products → v1/products}/index.v1.rabl +1 -1
  73. data/app/views/spree/api/{products → v1/products}/new.v1.rabl +0 -0
  74. data/app/views/spree/api/{products → v1/products}/product.v1.rabl +0 -0
  75. data/app/views/spree/api/{products → v1/products}/show.v1.rabl +3 -3
  76. data/app/views/spree/api/{promotions → v1/promotions}/handler.v1.rabl +0 -0
  77. data/app/views/spree/api/{promotions → v1/promotions}/show.v1.rabl +0 -0
  78. data/app/views/spree/api/{properties → v1/properties}/index.v1.rabl +0 -0
  79. data/app/views/spree/api/{properties → v1/properties}/new.v1.rabl +0 -0
  80. data/app/views/spree/api/{properties → v1/properties}/show.v1.rabl +0 -0
  81. data/app/views/spree/api/{return_authorizations → v1/return_authorizations}/index.v1.rabl +0 -0
  82. data/app/views/spree/api/{return_authorizations → v1/return_authorizations}/new.v1.rabl +0 -0
  83. data/app/views/spree/api/{return_authorizations → v1/return_authorizations}/show.v1.rabl +0 -0
  84. data/app/views/spree/api/{shared → v1/shared}/stock_location_required.v1.rabl +0 -0
  85. data/app/views/spree/api/{shipments → v1/shipments}/big.v1.rabl +7 -7
  86. data/app/views/spree/api/{shipments → v1/shipments}/cannot_ready_shipment.v1.rabl +0 -0
  87. data/app/views/spree/api/{shipments → v1/shipments}/mine.v1.rabl +1 -1
  88. data/app/views/spree/api/{shipments → v1/shipments}/show.v1.rabl +3 -3
  89. data/app/views/spree/api/{shipments → v1/shipments}/small.v1.rabl +3 -3
  90. data/app/views/spree/api/{shipping_rates → v1/shipping_rates}/show.v1.rabl +0 -0
  91. data/app/views/spree/api/{states → v1/states}/index.v1.rabl +0 -0
  92. data/app/views/spree/api/{states → v1/states}/show.v1.rabl +0 -0
  93. data/app/views/spree/api/{stock_items → v1/stock_items}/index.v1.rabl +1 -1
  94. data/app/views/spree/api/{stock_items → v1/stock_items}/show.v1.rabl +1 -1
  95. data/app/views/spree/api/{stock_locations → v1/stock_locations}/index.v1.rabl +1 -1
  96. data/app/views/spree/api/{stock_locations → v1/stock_locations}/show.v1.rabl +0 -0
  97. data/app/views/spree/api/{stock_movements → v1/stock_movements}/index.v1.rabl +1 -1
  98. data/app/views/spree/api/{stock_movements → v1/stock_movements}/show.v1.rabl +1 -1
  99. data/app/views/spree/api/{stores → v1/stores}/index.v1.rabl +0 -0
  100. data/app/views/spree/api/{stores → v1/stores}/show.v1.rabl +0 -0
  101. data/app/views/spree/api/{taxonomies → v1/taxonomies}/index.v1.rabl +1 -1
  102. data/app/views/spree/api/{taxonomies → v1/taxonomies}/jstree.rabl +0 -0
  103. data/app/views/spree/api/{taxonomies → v1/taxonomies}/nested.v1.rabl +1 -1
  104. data/app/views/spree/api/{taxonomies → v1/taxonomies}/new.v1.rabl +0 -0
  105. data/app/views/spree/api/{taxonomies → v1/taxonomies}/show.v1.rabl +4 -4
  106. data/app/views/spree/api/{taxons → v1/taxons}/index.v1.rabl +1 -1
  107. data/app/views/spree/api/{taxons → v1/taxons}/jstree.rabl +0 -0
  108. data/app/views/spree/api/{taxons → v1/taxons}/new.v1.rabl +0 -0
  109. data/app/views/spree/api/{taxons → v1/taxons}/show.v1.rabl +0 -0
  110. data/app/views/spree/api/v1/taxons/taxons.v1.rabl +5 -0
  111. data/app/views/spree/api/{users → v1/users}/index.v1.rabl +1 -1
  112. data/app/views/spree/api/{users → v1/users}/new.v1.rabl +0 -0
  113. data/app/views/spree/api/{users → v1/users}/show.v1.rabl +2 -2
  114. data/app/views/spree/api/{variants → v1/variants}/big.v1.rabl +1 -1
  115. data/app/views/spree/api/{variants → v1/variants}/index.v1.rabl +1 -1
  116. data/app/views/spree/api/{variants → v1/variants}/new.v1.rabl +0 -0
  117. data/app/views/spree/api/{variants → v1/variants}/show.v1.rabl +1 -1
  118. data/app/views/spree/api/{variants → v1/variants}/small.v1.rabl +1 -1
  119. data/app/views/spree/api/{zones → v1/zones}/index.v1.rabl +1 -1
  120. data/app/views/spree/api/{zones → v1/zones}/show.v1.rabl +0 -0
  121. data/config/routes.rb +85 -88
  122. data/spec/controllers/spree/api/base_controller_spec.rb +14 -42
  123. data/spec/controllers/spree/api/{addresses_controller_spec.rb → v1/addresses_controller_spec.rb} +1 -1
  124. data/spec/controllers/spree/api/{checkouts_controller_spec.rb → v1/checkouts_controller_spec.rb} +51 -3
  125. data/spec/controllers/spree/api/{classifications_controller_spec.rb → v1/classifications_controller_spec.rb} +2 -2
  126. data/spec/controllers/spree/api/{countries_controller_spec.rb → v1/countries_controller_spec.rb} +1 -1
  127. data/spec/controllers/spree/api/{credit_cards_controller_spec.rb → v1/credit_cards_controller_spec.rb} +1 -1
  128. data/spec/controllers/spree/api/{images_controller_spec.rb → v1/images_controller_spec.rb} +23 -1
  129. data/spec/controllers/spree/api/{inventory_units_controller_spec.rb → v1/inventory_units_controller_spec.rb} +1 -1
  130. data/spec/controllers/spree/api/{line_items_controller_spec.rb → v1/line_items_controller_spec.rb} +2 -2
  131. data/spec/controllers/spree/api/{option_types_controller_spec.rb → v1/option_types_controller_spec.rb} +9 -3
  132. data/spec/controllers/spree/api/{option_values_controller_spec.rb → v1/option_values_controller_spec.rb} +8 -2
  133. data/spec/controllers/spree/api/{orders_controller_spec.rb → v1/orders_controller_spec.rb} +29 -8
  134. data/spec/controllers/spree/api/{payments_controller_spec.rb → v1/payments_controller_spec.rb} +2 -2
  135. data/spec/controllers/spree/api/{product_properties_controller_spec.rb → v1/product_properties_controller_spec.rb} +1 -1
  136. data/spec/controllers/spree/api/{products_controller_spec.rb → v1/products_controller_spec.rb} +5 -5
  137. data/spec/controllers/spree/api/{promotion_application_spec.rb → v1/promotion_application_spec.rb} +2 -2
  138. data/spec/controllers/spree/api/{promotions_controller_spec.rb → v1/promotions_controller_spec.rb} +1 -1
  139. data/spec/controllers/spree/api/{properties_controller_spec.rb → v1/properties_controller_spec.rb} +1 -1
  140. data/spec/controllers/spree/api/{return_authorizations_controller_spec.rb → v1/return_authorizations_controller_spec.rb} +1 -1
  141. data/spec/controllers/spree/api/{shipments_controller_spec.rb → v1/shipments_controller_spec.rb} +4 -4
  142. data/spec/controllers/spree/api/{states_controller_spec.rb → v1/states_controller_spec.rb} +14 -10
  143. data/spec/controllers/spree/api/{stock_items_controller_spec.rb → v1/stock_items_controller_spec.rb} +1 -1
  144. data/spec/controllers/spree/api/{stock_locations_controller_spec.rb → v1/stock_locations_controller_spec.rb} +1 -1
  145. data/spec/controllers/spree/api/{stock_movements_controller_spec.rb → v1/stock_movements_controller_spec.rb} +1 -1
  146. data/spec/controllers/spree/api/{stores_controller_spec.rb → v1/stores_controller_spec.rb} +1 -1
  147. data/spec/controllers/spree/api/{taxonomies_controller_spec.rb → v1/taxonomies_controller_spec.rb} +1 -1
  148. data/spec/controllers/spree/api/{taxons_controller_spec.rb → v1/taxons_controller_spec.rb} +1 -1
  149. data/spec/controllers/spree/api/{unauthenticated_products_controller_spec.rb → v1/unauthenticated_products_controller_spec.rb} +1 -1
  150. data/spec/controllers/spree/api/{users_controller_spec.rb → v1/users_controller_spec.rb} +1 -1
  151. data/spec/controllers/spree/api/{variants_controller_spec.rb → v1/variants_controller_spec.rb} +3 -3
  152. data/spec/controllers/spree/api/{zones_controller_spec.rb → v1/zones_controller_spec.rb} +7 -5
  153. data/spec/requests/rabl_cache_spec.rb +2 -2
  154. data/spec/requests/ransackable_attributes_spec.rb +6 -6
  155. data/spec/requests/version_spec.rb +19 -0
  156. data/spree_api.gemspec +1 -1
  157. metadata +188 -185
  158. data/CHANGELOG.md +0 -3
  159. data/app/controllers/spree/api/addresses_controller.rb +0 -43
  160. data/app/controllers/spree/api/checkouts_controller.rb +0 -98
  161. data/app/controllers/spree/api/classifications_controller.rb +0 -18
  162. data/app/controllers/spree/api/countries_controller.rb +0 -23
  163. data/app/controllers/spree/api/credit_cards_controller.rb +0 -25
  164. data/app/controllers/spree/api/images_controller.rb +0 -47
  165. data/app/controllers/spree/api/inventory_units_controller.rb +0 -52
  166. data/app/controllers/spree/api/line_items_controller.rb +0 -69
  167. data/app/controllers/spree/api/option_types_controller.rb +0 -49
  168. data/app/controllers/spree/api/option_values_controller.rb +0 -58
  169. data/app/controllers/spree/api/orders_controller.rb +0 -130
  170. data/app/controllers/spree/api/payments_controller.rb +0 -80
  171. data/app/controllers/spree/api/product_properties_controller.rb +0 -72
  172. data/app/controllers/spree/api/products_controller.rb +0 -124
  173. data/app/controllers/spree/api/promotions_controller.rb +0 -26
  174. data/app/controllers/spree/api/properties_controller.rb +0 -70
  175. data/app/controllers/spree/api/return_authorizations_controller.rb +0 -69
  176. data/app/controllers/spree/api/shipments_controller.rb +0 -149
  177. data/app/controllers/spree/api/states_controller.rb +0 -38
  178. data/app/controllers/spree/api/stock_items_controller.rb +0 -75
  179. data/app/controllers/spree/api/stock_locations_controller.rb +0 -50
  180. data/app/controllers/spree/api/stock_movements_controller.rb +0 -43
  181. data/app/controllers/spree/api/stores_controller.rb +0 -55
  182. data/app/controllers/spree/api/taxonomies_controller.rb +0 -64
  183. data/app/controllers/spree/api/taxons_controller.rb +0 -93
  184. data/app/controllers/spree/api/users_controller.rb +0 -56
  185. data/app/controllers/spree/api/variants_controller.rb +0 -73
  186. data/app/controllers/spree/api/zones_controller.rb +0 -49
  187. data/app/models/spree/option_value_decorator.rb +0 -9
  188. data/app/views/spree/api/option_types/index.v1.rabl +0 -3
  189. data/app/views/spree/api/option_values/index.v1.rabl +0 -3
  190. data/app/views/spree/api/taxons/taxons.v1.rabl +0 -5
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
  require 'shared_examples/protect_product_actions'
3
3
 
4
4
  module Spree
5
- describe Spree::Api::ProductPropertiesController, :type => :controller do
5
+ describe Api::V1::ProductPropertiesController, :type => :controller do
6
6
  render_views
7
7
 
8
8
  let!(:product) { create(:product) }
@@ -2,11 +2,11 @@ require 'spec_helper'
2
2
  require 'shared_examples/protect_product_actions'
3
3
 
4
4
  module Spree
5
- describe Spree::Api::ProductsController, :type => :controller do
5
+ describe Api::V1::ProductsController, :type => :controller do
6
6
  render_views
7
7
 
8
8
  let!(:product) { create(:product) }
9
- let!(:inactive_product) { create(:product, available_on: Time.now.tomorrow, name: "inactive") }
9
+ let!(:inactive_product) { create(:product, available_on: Time.current.tomorrow, name: "inactive") }
10
10
  let(:base_attributes) { Api::ApiHelpers.product_attributes }
11
11
  let(:show_attributes) { base_attributes.dup.push(:has_variants) }
12
12
  let(:new_attributes) { base_attributes }
@@ -126,7 +126,7 @@ module Spree
126
126
 
127
127
  it "gets a single product" do
128
128
  product.master.images.create!(:attachment => image("thinking-cat.jpg"))
129
- product.variants.create!
129
+ create(:variant, product: product)
130
130
  product.variants.first.images.create!(:attachment => image("thinking-cat.jpg"))
131
131
  product.set_property("spree", "rocks")
132
132
  product.taxons << create(:taxon)
@@ -202,7 +202,7 @@ module Spree
202
202
  required_attributes = json_response["required_attributes"]
203
203
  expect(required_attributes).to include("name")
204
204
  expect(required_attributes).to include("price")
205
- expect(required_attributes).to include("shipping_category_id")
205
+ expect(required_attributes).to include("shipping_category")
206
206
  end
207
207
 
208
208
  it_behaves_like "modifying product actions are restricted"
@@ -335,7 +335,7 @@ module Spree
335
335
  expect(json_response["error"]).to eq("Invalid resource. Please fix errors and try again.")
336
336
  errors = json_response["errors"]
337
337
  errors.delete("slug") # Don't care about this one.
338
- expect(errors.keys).to match_array(["name", "price", "shipping_category_id"])
338
+ expect(errors.keys).to match_array(["name", "price", "shipping_category"])
339
339
  end
340
340
  end
341
341
 
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
- module Spree::Api
4
- describe OrdersController, :type => :controller do
3
+ module Spree
4
+ describe Api::V1::OrdersController, :type => :controller do
5
5
  render_views
6
6
 
7
7
  before do
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  module Spree
4
- describe Spree::Api::PromotionsController, :type => :controller do
4
+ describe Api::V1::PromotionsController, :type => :controller do
5
5
  render_views
6
6
 
7
7
  shared_examples "a JSON response" do
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
  module Spree
3
- describe Spree::Api::PropertiesController, :type => :controller do
3
+ describe Api::V1::PropertiesController, :type => :controller do
4
4
  render_views
5
5
 
6
6
  let!(:property_1) { Property.create!(:name => "foo", :presentation => "Foo") }
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  module Spree
4
- describe Api::ReturnAuthorizationsController, :type => :controller do
4
+ describe Api::V1::ReturnAuthorizationsController, :type => :controller do
5
5
  render_views
6
6
 
7
7
  let!(:order) { create(:shipped_order) }
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe Spree::Api::ShipmentsController, :type => :controller do
3
+ describe Spree::Api::V1::ShipmentsController, :type => :controller do
4
4
  render_views
5
5
  let!(:shipment) { create(:shipment) }
6
6
  let!(:attributes) { [:id, :tracking, :number, :cost, :shipped_at, :stock_location_name, :order_id, :shipping_rates, :shipping_methods] }
@@ -38,9 +38,9 @@ describe Spree::Api::ShipmentsController, :type => :controller do
38
38
  shipment: { order_id: order.number },
39
39
  stock_location_id: stock_location.to_param
40
40
  }
41
- end
42
-
43
- subject do
41
+ end
42
+
43
+ subject do
44
44
  api_post :create, params
45
45
  end
46
46
 
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  module Spree
4
- describe Api::StatesController, :type => :controller do
4
+ describe Api::V1::StatesController, :type => :controller do
5
5
  render_views
6
6
 
7
7
  let!(:state) { create(:state, :name => "Victoria") }
@@ -24,26 +24,30 @@ module Spree
24
24
  end
25
25
 
26
26
  context "pagination" do
27
+ let(:scope) { double('scope') }
28
+
27
29
  before do
28
- expect(State).to receive(:accessible_by).and_return(@scope = double)
29
- allow(@scope).to receive_message_chain(:ransack, :result, :includes, :order).and_return(@scope)
30
+ expect(scope).to receive_messages(last: state)
31
+ expect(State).to receive_messages(accessible_by: scope)
32
+ expect(scope).to receive_messages(order: scope)
33
+ allow(scope).to receive_message_chain(:ransack, :result, :includes).and_return(scope)
30
34
  end
31
35
 
32
36
  it "does not paginate states results when asked not to do so" do
33
- expect(@scope).not_to receive(:page)
34
- expect(@scope).not_to receive(:per)
37
+ expect(scope).not_to receive(:page)
38
+ expect(scope).not_to receive(:per)
35
39
  api_get :index
36
40
  end
37
41
 
38
42
  it "paginates when page parameter is passed through" do
39
- expect(@scope).to receive(:page).with(1).and_return(@scope)
40
- expect(@scope).to receive(:per).with(nil)
43
+ expect(scope).to receive(:page).with(1).and_return(scope)
44
+ expect(scope).to receive(:per).with(nil).and_return(scope)
41
45
  api_get :index, :page => 1
42
46
  end
43
47
 
44
48
  it "paginates when per_page parameter is passed through" do
45
- expect(@scope).to receive(:page).with(nil).and_return(@scope)
46
- expect(@scope).to receive(:per).with(25)
49
+ expect(scope).to receive(:page).with(nil).and_return(scope)
50
+ expect(scope).to receive(:per).with(25).and_return(scope)
47
51
  api_get :index, :per_page => 25
48
52
  end
49
53
  end
@@ -54,7 +58,7 @@ module Spree
54
58
 
55
59
  it "gets all states for a country" do
56
60
  country = create(:country, :states_required => true)
57
- state.country = country
61
+ state.country = country
58
62
  state.save
59
63
 
60
64
  api_get :index, :country_id => country.id
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  module Spree
4
- describe Api::StockItemsController, :type => :controller do
4
+ describe Api::V1::StockItemsController, :type => :controller do
5
5
  render_views
6
6
 
7
7
  let!(:stock_location) { create(:stock_location_with_items) }
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  module Spree
4
- describe Api::StockLocationsController, :type => :controller do
4
+ describe Api::V1::StockLocationsController, :type => :controller do
5
5
  render_views
6
6
 
7
7
  let!(:stock_location) { create(:stock_location) }
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  module Spree
4
- describe Api::StockMovementsController, :type => :controller do
4
+ describe Api::V1::StockMovementsController, :type => :controller do
5
5
  render_views
6
6
 
7
7
  let!(:stock_location) { create(:stock_location_with_items) }
@@ -1,7 +1,7 @@
1
1
  require "spec_helper"
2
2
 
3
3
  module Spree
4
- describe Api::StoresController, type: :controller do
4
+ describe Api::V1::StoresController, type: :controller do
5
5
  render_views
6
6
 
7
7
  let!(:store) do
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  module Spree
4
- describe Api::TaxonomiesController, :type => :controller do
4
+ describe Api::V1::TaxonomiesController, :type => :controller do
5
5
  render_views
6
6
 
7
7
  let(:taxonomy) { create(:taxonomy) }
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  module Spree
4
- describe Api::TaxonsController, :type => :controller do
4
+ describe Api::V1::TaxonsController, :type => :controller do
5
5
  render_views
6
6
 
7
7
  let(:taxonomy) { create(:taxonomy) }
@@ -2,7 +2,7 @@ require 'shared_examples/protect_product_actions'
2
2
  require 'spec_helper'
3
3
 
4
4
  module Spree
5
- describe Spree::Api::ProductsController, :type => :controller do
5
+ describe Api::V1::ProductsController, :type => :controller do
6
6
  render_views
7
7
 
8
8
  let!(:product) { create(:product) }
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  module Spree
4
- describe Api::UsersController, :type => :controller do
4
+ describe Api::V1::UsersController, :type => :controller do
5
5
  render_views
6
6
 
7
7
  let(:user) { create(:user, spree_api_key: rand.to_s) }
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  module Spree
4
- describe Api::VariantsController, :type => :controller do
4
+ describe Api::V1::VariantsController, :type => :controller do
5
5
  render_views
6
6
 
7
7
  let(:option_value) { create(:option_value) }
@@ -79,7 +79,7 @@ module Spree
79
79
  # Regression test for #2141
80
80
  context "a deleted variant" do
81
81
  before do
82
- variant.update_column(:deleted_at, Time.now)
82
+ variant.update_column(:deleted_at, Time.current)
83
83
  end
84
84
 
85
85
  it "is not returned in the results" do
@@ -157,7 +157,7 @@ module Spree
157
157
  # Test for #2141
158
158
  context "deleted variants" do
159
159
  before do
160
- variant.update_column(:deleted_at, Time.now)
160
+ variant.update_column(:deleted_at, Time.current)
161
161
  end
162
162
 
163
163
  it "are visible by admin" do
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  module Spree
4
- describe Api::ZonesController, :type => :controller do
4
+ describe Api::V1::ZonesController, :type => :controller do
5
5
  render_views
6
6
 
7
7
  let!(:attributes) { [:id, :name, :zone_members] }
@@ -41,14 +41,16 @@ module Spree
41
41
  context "as an admin" do
42
42
  sign_in_as_admin!
43
43
 
44
+ let!(:country) { create(:country) }
45
+
44
46
  it "can create a new zone" do
45
47
  params = {
46
48
  :zone => {
47
49
  :name => "North Pole",
48
50
  :zone_members => [
49
51
  {
50
- :zoneable_type => "Spree::Country",
51
- :zoneable_id => 1
52
+ zoneable_type: "Spree::Country",
53
+ zoneable_id: country.id
52
54
  }
53
55
  ]
54
56
  }
@@ -66,8 +68,8 @@ module Spree
66
68
  :name => "North Pole",
67
69
  :zone_members => [
68
70
  {
69
- :zoneable_type => "Spree::Country",
70
- :zoneable_id => 1
71
+ zoneable_type: "Spree::Country",
72
+ zoneable_id: country.id
71
73
  }
72
74
  ]
73
75
  }
@@ -10,7 +10,7 @@ describe "Rabl Cache", :type => :request, :caching => true do
10
10
  end
11
11
 
12
12
  it "doesn't create a cache key collision for models with different rabl templates" do
13
- get "/api/variants", :token => user.spree_api_key
13
+ get "/api/v1/variants", :token => user.spree_api_key
14
14
  expect(response.status).to eq(200)
15
15
 
16
16
  # Make sure we get a non master variant
@@ -21,7 +21,7 @@ describe "Rabl Cache", :type => :request, :caching => true do
21
21
  expect(variant_a['is_master']).to be false
22
22
  expect(variant_a['stock_items']).not_to be_nil
23
23
 
24
- get "/api/products/#{Spree::Product.first.id}", :token => user.spree_api_key
24
+ get "/api/v1/products/#{Spree::Product.first.id}", :token => user.spree_api_key
25
25
  expect(response.status).to eq(200)
26
26
  variant_b = JSON.parse(response.body)['variants'].last
27
27
  expect(variant_b['is_master']).to be false
@@ -7,7 +7,7 @@ describe "Ransackable Attributes" do
7
7
  it "does not allow the filtering of variants by order attributes" do
8
8
  2.times { create(:variant) }
9
9
 
10
- get "/api/variants?q[orders_email_start]=#{order.email}", token: user.spree_api_key
10
+ get "/api/v1/variants?q[orders_email_start]=#{order.email}", token: user.spree_api_key
11
11
 
12
12
  variants_response = JSON.parse(response.body)
13
13
  expect(variants_response['total_count']).to eq(Spree::Variant.count)
@@ -18,7 +18,7 @@ describe "Ransackable Attributes" do
18
18
  it "does not allow the filtering of variants by user attributes" do
19
19
  2.times { create(:variant) }
20
20
 
21
- get "/api/variants?q[orders_user_email_start]=#{order.user.email}", token: user.spree_api_key
21
+ get "/api/v1/variants?q[orders_user_email_start]=#{order.user.email}", token: user.spree_api_key
22
22
 
23
23
  variants_response = JSON.parse(response.body)
24
24
  expect(variants_response['total_count']).to eq(Spree::Variant.count)
@@ -31,7 +31,7 @@ describe "Ransackable Attributes" do
31
31
  variant = create(:variant, product: product)
32
32
  other_variant = create(:variant)
33
33
 
34
- get "/api/variants?q[product_name_or_sku_cont]=fritos", token: user.spree_api_key
34
+ get "/api/v1/variants?q[product_name_or_sku_cont]=fritos", token: user.spree_api_key
35
35
 
36
36
  skus = JSON.parse(response.body)['variants'].map { |variant| variant['sku'] }
37
37
  expect(skus).to include variant.sku
@@ -44,7 +44,7 @@ describe "Ransackable Attributes" do
44
44
  product = create(:product, meta_title: "special product")
45
45
  other_product = create(:product)
46
46
 
47
- get "/api/products?q[meta_title_cont]=special", token: user.spree_api_key
47
+ get "/api/v1/products?q[meta_title_cont]=special", token: user.spree_api_key
48
48
 
49
49
  products_response = JSON.parse(response.body)
50
50
  expect(products_response['total_count']).to eq(Spree::Product.count)
@@ -54,7 +54,7 @@ describe "Ransackable Attributes" do
54
54
  product = create(:product)
55
55
  other_product = create(:product)
56
56
 
57
- get "/api/products?q[id_eq]=#{product.id}", token: user.spree_api_key
57
+ get "/api/v1/products?q[id_eq]=#{product.id}", token: user.spree_api_key
58
58
 
59
59
  product_names = JSON.parse(response.body)['products'].map { |product| product['name'] }
60
60
  expect(product_names).to include product.name
@@ -67,7 +67,7 @@ describe "Ransackable Attributes" do
67
67
  product = create(:product, name: "Fritos")
68
68
  other_product = create(:product)
69
69
 
70
- get "/api/products?q[name_cont]=fritos", token: user.spree_api_key
70
+ get "/api/v1/products?q[name_cont]=fritos", token: user.spree_api_key
71
71
 
72
72
  product_names = JSON.parse(response.body)['products'].map { |product| product['name'] }
73
73
  expect(product_names).to include product.name
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Version", type: :request do
4
+ let!(:countries) { 2.times.map { create :country } }
5
+
6
+ describe "/api" do
7
+ it "be a redirect" do
8
+ get "/api/countries"
9
+ expect(response).to have_http_status 301
10
+ end
11
+ end
12
+
13
+ describe "/api/v1" do
14
+ it "be successful" do
15
+ get "/api/v1/countries"
16
+ expect(response).to have_http_status 200
17
+ end
18
+ end
19
+ end
data/spree_api.gemspec CHANGED
@@ -17,6 +17,6 @@ Gem::Specification.new do |s|
17
17
  s.version = Spree.version
18
18
 
19
19
  s.add_dependency 'spree_core', s.version
20
- s.add_dependency 'rabl', '~> 0.11.6'
20
+ s.add_dependency 'rabl', '~> 0.12.0'
21
21
  s.add_dependency 'versioncake', '~> 2.3.1'
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.10
4
+ version: 3.1.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Bigg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-16 00:00:00.000000000 Z
11
+ date: 2016-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_core
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.0.10
19
+ version: 3.1.0.rc1
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: 3.0.10
26
+ version: 3.1.0.rc1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rabl
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.11.6
33
+ version: 0.12.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.11.6
40
+ version: 0.12.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: versioncake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -60,134 +60,135 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - ".gitignore"
63
- - CHANGELOG.md
64
63
  - Gemfile
65
64
  - LICENSE
66
65
  - Rakefile
67
- - app/controllers/spree/api/addresses_controller.rb
68
66
  - app/controllers/spree/api/base_controller.rb
69
- - app/controllers/spree/api/checkouts_controller.rb
70
- - app/controllers/spree/api/classifications_controller.rb
71
- - app/controllers/spree/api/countries_controller.rb
72
- - app/controllers/spree/api/credit_cards_controller.rb
73
- - app/controllers/spree/api/images_controller.rb
74
- - app/controllers/spree/api/inventory_units_controller.rb
75
- - app/controllers/spree/api/line_items_controller.rb
76
- - app/controllers/spree/api/option_types_controller.rb
77
- - app/controllers/spree/api/option_values_controller.rb
78
- - app/controllers/spree/api/orders_controller.rb
79
- - app/controllers/spree/api/payments_controller.rb
80
- - app/controllers/spree/api/product_properties_controller.rb
81
- - app/controllers/spree/api/products_controller.rb
82
- - app/controllers/spree/api/promotions_controller.rb
83
- - app/controllers/spree/api/properties_controller.rb
84
- - app/controllers/spree/api/return_authorizations_controller.rb
85
- - app/controllers/spree/api/shipments_controller.rb
86
- - app/controllers/spree/api/states_controller.rb
87
- - app/controllers/spree/api/stock_items_controller.rb
88
- - app/controllers/spree/api/stock_locations_controller.rb
89
- - app/controllers/spree/api/stock_movements_controller.rb
90
- - app/controllers/spree/api/stores_controller.rb
91
- - app/controllers/spree/api/taxonomies_controller.rb
92
- - app/controllers/spree/api/taxons_controller.rb
93
- - app/controllers/spree/api/users_controller.rb
94
- - app/controllers/spree/api/variants_controller.rb
95
- - app/controllers/spree/api/zones_controller.rb
67
+ - app/controllers/spree/api/v1/addresses_controller.rb
68
+ - app/controllers/spree/api/v1/checkouts_controller.rb
69
+ - app/controllers/spree/api/v1/classifications_controller.rb
70
+ - app/controllers/spree/api/v1/countries_controller.rb
71
+ - app/controllers/spree/api/v1/credit_cards_controller.rb
72
+ - app/controllers/spree/api/v1/images_controller.rb
73
+ - app/controllers/spree/api/v1/inventory_units_controller.rb
74
+ - app/controllers/spree/api/v1/line_items_controller.rb
75
+ - app/controllers/spree/api/v1/option_types_controller.rb
76
+ - app/controllers/spree/api/v1/option_values_controller.rb
77
+ - app/controllers/spree/api/v1/orders_controller.rb
78
+ - app/controllers/spree/api/v1/payments_controller.rb
79
+ - app/controllers/spree/api/v1/product_properties_controller.rb
80
+ - app/controllers/spree/api/v1/products_controller.rb
81
+ - app/controllers/spree/api/v1/promotions_controller.rb
82
+ - app/controllers/spree/api/v1/properties_controller.rb
83
+ - app/controllers/spree/api/v1/return_authorizations_controller.rb
84
+ - app/controllers/spree/api/v1/shipments_controller.rb
85
+ - app/controllers/spree/api/v1/states_controller.rb
86
+ - app/controllers/spree/api/v1/stock_items_controller.rb
87
+ - app/controllers/spree/api/v1/stock_locations_controller.rb
88
+ - app/controllers/spree/api/v1/stock_movements_controller.rb
89
+ - app/controllers/spree/api/v1/stores_controller.rb
90
+ - app/controllers/spree/api/v1/taxonomies_controller.rb
91
+ - app/controllers/spree/api/v1/taxons_controller.rb
92
+ - app/controllers/spree/api/v1/users_controller.rb
93
+ - app/controllers/spree/api/v1/variants_controller.rb
94
+ - app/controllers/spree/api/v1/zones_controller.rb
96
95
  - app/helpers/spree/api/api_helpers.rb
97
96
  - app/models/spree/api_configuration.rb
98
- - app/models/spree/option_value_decorator.rb
99
- - app/views/spree/api/addresses/show.v1.rabl
100
- - app/views/spree/api/adjustments/show.v1.rabl
101
- - app/views/spree/api/config/money.v1.rabl
102
- - app/views/spree/api/config/show.v1.rabl
103
- - app/views/spree/api/countries/index.v1.rabl
104
- - app/views/spree/api/countries/show.v1.rabl
105
- - app/views/spree/api/credit_cards/index.v1.rabl
106
- - app/views/spree/api/credit_cards/show.v1.rabl
107
97
  - app/views/spree/api/errors/gateway_error.v1.rabl
108
98
  - app/views/spree/api/errors/invalid_api_key.v1.rabl
109
99
  - app/views/spree/api/errors/invalid_resource.v1.rabl
110
100
  - app/views/spree/api/errors/must_specify_api_key.v1.rabl
111
101
  - app/views/spree/api/errors/not_found.v1.rabl
112
102
  - app/views/spree/api/errors/unauthorized.v1.rabl
113
- - app/views/spree/api/images/index.v1.rabl
114
- - app/views/spree/api/images/show.v1.rabl
115
- - app/views/spree/api/inventory_units/show.rabl
116
- - app/views/spree/api/line_items/new.v1.rabl
117
- - app/views/spree/api/line_items/show.v1.rabl
118
- - app/views/spree/api/option_types/index.v1.rabl
119
- - app/views/spree/api/option_types/show.v1.rabl
120
- - app/views/spree/api/option_values/index.v1.rabl
121
- - app/views/spree/api/option_values/show.v1.rabl
122
- - app/views/spree/api/orders/address.v1.rabl
123
- - app/views/spree/api/orders/canceled.v1.rabl
124
- - app/views/spree/api/orders/cart.v1.rabl
125
- - app/views/spree/api/orders/complete.v1.rabl
126
- - app/views/spree/api/orders/could_not_apply_coupon.v1.rabl
127
- - app/views/spree/api/orders/could_not_transition.v1.rabl
128
- - app/views/spree/api/orders/index.v1.rabl
129
- - app/views/spree/api/orders/invalid_shipping_method.v1.rabl
130
- - app/views/spree/api/orders/mine.v1.rabl
131
- - app/views/spree/api/orders/order.v1.rabl
132
- - app/views/spree/api/orders/payment.v1.rabl
133
- - app/views/spree/api/orders/show.v1.rabl
134
- - app/views/spree/api/payments/credit_over_limit.v1.rabl
135
- - app/views/spree/api/payments/index.v1.rabl
136
- - app/views/spree/api/payments/new.v1.rabl
137
- - app/views/spree/api/payments/show.v1.rabl
138
- - app/views/spree/api/payments/update_forbidden.v1.rabl
139
- - app/views/spree/api/product_properties/index.v1.rabl
140
- - app/views/spree/api/product_properties/new.v1.rabl
141
- - app/views/spree/api/product_properties/show.v1.rabl
142
- - app/views/spree/api/products/index.v1.rabl
143
- - app/views/spree/api/products/new.v1.rabl
144
- - app/views/spree/api/products/product.v1.rabl
145
- - app/views/spree/api/products/show.v1.rabl
146
- - app/views/spree/api/promotions/handler.v1.rabl
147
- - app/views/spree/api/promotions/show.v1.rabl
148
- - app/views/spree/api/properties/index.v1.rabl
149
- - app/views/spree/api/properties/new.v1.rabl
150
- - app/views/spree/api/properties/show.v1.rabl
151
- - app/views/spree/api/return_authorizations/index.v1.rabl
152
- - app/views/spree/api/return_authorizations/new.v1.rabl
153
- - app/views/spree/api/return_authorizations/show.v1.rabl
154
- - app/views/spree/api/shared/stock_location_required.v1.rabl
155
- - app/views/spree/api/shipments/big.v1.rabl
156
- - app/views/spree/api/shipments/cannot_ready_shipment.v1.rabl
157
- - app/views/spree/api/shipments/mine.v1.rabl
158
- - app/views/spree/api/shipments/show.v1.rabl
159
- - app/views/spree/api/shipments/small.v1.rabl
160
- - app/views/spree/api/shipping_rates/show.v1.rabl
161
- - app/views/spree/api/states/index.v1.rabl
162
- - app/views/spree/api/states/show.v1.rabl
163
- - app/views/spree/api/stock_items/index.v1.rabl
164
- - app/views/spree/api/stock_items/show.v1.rabl
165
- - app/views/spree/api/stock_locations/index.v1.rabl
166
- - app/views/spree/api/stock_locations/show.v1.rabl
167
- - app/views/spree/api/stock_movements/index.v1.rabl
168
- - app/views/spree/api/stock_movements/show.v1.rabl
169
- - app/views/spree/api/stores/index.v1.rabl
170
- - app/views/spree/api/stores/show.v1.rabl
171
- - app/views/spree/api/taxonomies/index.v1.rabl
172
- - app/views/spree/api/taxonomies/jstree.rabl
173
- - app/views/spree/api/taxonomies/nested.v1.rabl
174
- - app/views/spree/api/taxonomies/new.v1.rabl
175
- - app/views/spree/api/taxonomies/show.v1.rabl
176
- - app/views/spree/api/taxons/index.v1.rabl
177
- - app/views/spree/api/taxons/jstree.rabl
178
- - app/views/spree/api/taxons/new.v1.rabl
179
- - app/views/spree/api/taxons/show.v1.rabl
180
- - app/views/spree/api/taxons/taxons.v1.rabl
181
- - app/views/spree/api/users/index.v1.rabl
182
- - app/views/spree/api/users/new.v1.rabl
183
- - app/views/spree/api/users/show.v1.rabl
184
- - app/views/spree/api/variants/big.v1.rabl
185
- - app/views/spree/api/variants/index.v1.rabl
186
- - app/views/spree/api/variants/new.v1.rabl
187
- - app/views/spree/api/variants/show.v1.rabl
188
- - app/views/spree/api/variants/small.v1.rabl
189
- - app/views/spree/api/zones/index.v1.rabl
190
- - app/views/spree/api/zones/show.v1.rabl
103
+ - app/views/spree/api/v1/addresses/show.v1.rabl
104
+ - app/views/spree/api/v1/adjustments/show.v1.rabl
105
+ - app/views/spree/api/v1/config/money.v1.rabl
106
+ - app/views/spree/api/v1/config/show.v1.rabl
107
+ - app/views/spree/api/v1/countries/index.v1.rabl
108
+ - app/views/spree/api/v1/countries/show.v1.rabl
109
+ - app/views/spree/api/v1/credit_cards/index.v1.rabl
110
+ - app/views/spree/api/v1/credit_cards/show.v1.rabl
111
+ - app/views/spree/api/v1/images/index.v1.rabl
112
+ - app/views/spree/api/v1/images/new.v1.rabl
113
+ - app/views/spree/api/v1/images/show.v1.rabl
114
+ - app/views/spree/api/v1/inventory_units/show.rabl
115
+ - app/views/spree/api/v1/line_items/new.v1.rabl
116
+ - app/views/spree/api/v1/line_items/show.v1.rabl
117
+ - app/views/spree/api/v1/option_types/index.v1.rabl
118
+ - app/views/spree/api/v1/option_types/new.v1.rabl
119
+ - app/views/spree/api/v1/option_types/show.v1.rabl
120
+ - app/views/spree/api/v1/option_values/index.v1.rabl
121
+ - app/views/spree/api/v1/option_values/new.v1.rabl
122
+ - app/views/spree/api/v1/option_values/show.v1.rabl
123
+ - app/views/spree/api/v1/orders/address.v1.rabl
124
+ - app/views/spree/api/v1/orders/canceled.v1.rabl
125
+ - app/views/spree/api/v1/orders/cart.v1.rabl
126
+ - app/views/spree/api/v1/orders/complete.v1.rabl
127
+ - app/views/spree/api/v1/orders/could_not_apply_coupon.v1.rabl
128
+ - app/views/spree/api/v1/orders/could_not_transition.v1.rabl
129
+ - app/views/spree/api/v1/orders/index.v1.rabl
130
+ - app/views/spree/api/v1/orders/invalid_shipping_method.v1.rabl
131
+ - app/views/spree/api/v1/orders/mine.v1.rabl
132
+ - app/views/spree/api/v1/orders/order.v1.rabl
133
+ - app/views/spree/api/v1/orders/payment.v1.rabl
134
+ - app/views/spree/api/v1/orders/show.v1.rabl
135
+ - app/views/spree/api/v1/payments/credit_over_limit.v1.rabl
136
+ - app/views/spree/api/v1/payments/index.v1.rabl
137
+ - app/views/spree/api/v1/payments/new.v1.rabl
138
+ - app/views/spree/api/v1/payments/show.v1.rabl
139
+ - app/views/spree/api/v1/payments/update_forbidden.v1.rabl
140
+ - app/views/spree/api/v1/product_properties/index.v1.rabl
141
+ - app/views/spree/api/v1/product_properties/new.v1.rabl
142
+ - app/views/spree/api/v1/product_properties/show.v1.rabl
143
+ - app/views/spree/api/v1/products/index.v1.rabl
144
+ - app/views/spree/api/v1/products/new.v1.rabl
145
+ - app/views/spree/api/v1/products/product.v1.rabl
146
+ - app/views/spree/api/v1/products/show.v1.rabl
147
+ - app/views/spree/api/v1/promotions/handler.v1.rabl
148
+ - app/views/spree/api/v1/promotions/show.v1.rabl
149
+ - app/views/spree/api/v1/properties/index.v1.rabl
150
+ - app/views/spree/api/v1/properties/new.v1.rabl
151
+ - app/views/spree/api/v1/properties/show.v1.rabl
152
+ - app/views/spree/api/v1/return_authorizations/index.v1.rabl
153
+ - app/views/spree/api/v1/return_authorizations/new.v1.rabl
154
+ - app/views/spree/api/v1/return_authorizations/show.v1.rabl
155
+ - app/views/spree/api/v1/shared/stock_location_required.v1.rabl
156
+ - app/views/spree/api/v1/shipments/big.v1.rabl
157
+ - app/views/spree/api/v1/shipments/cannot_ready_shipment.v1.rabl
158
+ - app/views/spree/api/v1/shipments/mine.v1.rabl
159
+ - app/views/spree/api/v1/shipments/show.v1.rabl
160
+ - app/views/spree/api/v1/shipments/small.v1.rabl
161
+ - app/views/spree/api/v1/shipping_rates/show.v1.rabl
162
+ - app/views/spree/api/v1/states/index.v1.rabl
163
+ - app/views/spree/api/v1/states/show.v1.rabl
164
+ - app/views/spree/api/v1/stock_items/index.v1.rabl
165
+ - app/views/spree/api/v1/stock_items/show.v1.rabl
166
+ - app/views/spree/api/v1/stock_locations/index.v1.rabl
167
+ - app/views/spree/api/v1/stock_locations/show.v1.rabl
168
+ - app/views/spree/api/v1/stock_movements/index.v1.rabl
169
+ - app/views/spree/api/v1/stock_movements/show.v1.rabl
170
+ - app/views/spree/api/v1/stores/index.v1.rabl
171
+ - app/views/spree/api/v1/stores/show.v1.rabl
172
+ - app/views/spree/api/v1/taxonomies/index.v1.rabl
173
+ - app/views/spree/api/v1/taxonomies/jstree.rabl
174
+ - app/views/spree/api/v1/taxonomies/nested.v1.rabl
175
+ - app/views/spree/api/v1/taxonomies/new.v1.rabl
176
+ - app/views/spree/api/v1/taxonomies/show.v1.rabl
177
+ - app/views/spree/api/v1/taxons/index.v1.rabl
178
+ - app/views/spree/api/v1/taxons/jstree.rabl
179
+ - app/views/spree/api/v1/taxons/new.v1.rabl
180
+ - app/views/spree/api/v1/taxons/show.v1.rabl
181
+ - app/views/spree/api/v1/taxons/taxons.v1.rabl
182
+ - app/views/spree/api/v1/users/index.v1.rabl
183
+ - app/views/spree/api/v1/users/new.v1.rabl
184
+ - app/views/spree/api/v1/users/show.v1.rabl
185
+ - app/views/spree/api/v1/variants/big.v1.rabl
186
+ - app/views/spree/api/v1/variants/index.v1.rabl
187
+ - app/views/spree/api/v1/variants/new.v1.rabl
188
+ - app/views/spree/api/v1/variants/show.v1.rabl
189
+ - app/views/spree/api/v1/variants/small.v1.rabl
190
+ - app/views/spree/api/v1/zones/index.v1.rabl
191
+ - app/views/spree/api/v1/zones/show.v1.rabl
191
192
  - config/initializers/metal_load_paths.rb
192
193
  - config/locales/en.yml
193
194
  - config/routes.rb
@@ -205,41 +206,42 @@ files:
205
206
  - lib/spree/api/testing_support/setup.rb
206
207
  - lib/spree_api.rb
207
208
  - script/rails
208
- - spec/controllers/spree/api/addresses_controller_spec.rb
209
209
  - spec/controllers/spree/api/base_controller_spec.rb
210
- - spec/controllers/spree/api/checkouts_controller_spec.rb
211
- - spec/controllers/spree/api/classifications_controller_spec.rb
212
- - spec/controllers/spree/api/countries_controller_spec.rb
213
- - spec/controllers/spree/api/credit_cards_controller_spec.rb
214
- - spec/controllers/spree/api/images_controller_spec.rb
215
- - spec/controllers/spree/api/inventory_units_controller_spec.rb
216
- - spec/controllers/spree/api/line_items_controller_spec.rb
217
- - spec/controllers/spree/api/option_types_controller_spec.rb
218
- - spec/controllers/spree/api/option_values_controller_spec.rb
219
- - spec/controllers/spree/api/orders_controller_spec.rb
220
- - spec/controllers/spree/api/payments_controller_spec.rb
221
- - spec/controllers/spree/api/product_properties_controller_spec.rb
222
- - spec/controllers/spree/api/products_controller_spec.rb
223
- - spec/controllers/spree/api/promotion_application_spec.rb
224
- - spec/controllers/spree/api/promotions_controller_spec.rb
225
- - spec/controllers/spree/api/properties_controller_spec.rb
226
- - spec/controllers/spree/api/return_authorizations_controller_spec.rb
227
- - spec/controllers/spree/api/shipments_controller_spec.rb
228
- - spec/controllers/spree/api/states_controller_spec.rb
229
- - spec/controllers/spree/api/stock_items_controller_spec.rb
230
- - spec/controllers/spree/api/stock_locations_controller_spec.rb
231
- - spec/controllers/spree/api/stock_movements_controller_spec.rb
232
- - spec/controllers/spree/api/stores_controller_spec.rb
233
- - spec/controllers/spree/api/taxonomies_controller_spec.rb
234
- - spec/controllers/spree/api/taxons_controller_spec.rb
235
- - spec/controllers/spree/api/unauthenticated_products_controller_spec.rb
236
- - spec/controllers/spree/api/users_controller_spec.rb
237
- - spec/controllers/spree/api/variants_controller_spec.rb
238
- - spec/controllers/spree/api/zones_controller_spec.rb
210
+ - spec/controllers/spree/api/v1/addresses_controller_spec.rb
211
+ - spec/controllers/spree/api/v1/checkouts_controller_spec.rb
212
+ - spec/controllers/spree/api/v1/classifications_controller_spec.rb
213
+ - spec/controllers/spree/api/v1/countries_controller_spec.rb
214
+ - spec/controllers/spree/api/v1/credit_cards_controller_spec.rb
215
+ - spec/controllers/spree/api/v1/images_controller_spec.rb
216
+ - spec/controllers/spree/api/v1/inventory_units_controller_spec.rb
217
+ - spec/controllers/spree/api/v1/line_items_controller_spec.rb
218
+ - spec/controllers/spree/api/v1/option_types_controller_spec.rb
219
+ - spec/controllers/spree/api/v1/option_values_controller_spec.rb
220
+ - spec/controllers/spree/api/v1/orders_controller_spec.rb
221
+ - spec/controllers/spree/api/v1/payments_controller_spec.rb
222
+ - spec/controllers/spree/api/v1/product_properties_controller_spec.rb
223
+ - spec/controllers/spree/api/v1/products_controller_spec.rb
224
+ - spec/controllers/spree/api/v1/promotion_application_spec.rb
225
+ - spec/controllers/spree/api/v1/promotions_controller_spec.rb
226
+ - spec/controllers/spree/api/v1/properties_controller_spec.rb
227
+ - spec/controllers/spree/api/v1/return_authorizations_controller_spec.rb
228
+ - spec/controllers/spree/api/v1/shipments_controller_spec.rb
229
+ - spec/controllers/spree/api/v1/states_controller_spec.rb
230
+ - spec/controllers/spree/api/v1/stock_items_controller_spec.rb
231
+ - spec/controllers/spree/api/v1/stock_locations_controller_spec.rb
232
+ - spec/controllers/spree/api/v1/stock_movements_controller_spec.rb
233
+ - spec/controllers/spree/api/v1/stores_controller_spec.rb
234
+ - spec/controllers/spree/api/v1/taxonomies_controller_spec.rb
235
+ - spec/controllers/spree/api/v1/taxons_controller_spec.rb
236
+ - spec/controllers/spree/api/v1/unauthenticated_products_controller_spec.rb
237
+ - spec/controllers/spree/api/v1/users_controller_spec.rb
238
+ - spec/controllers/spree/api/v1/variants_controller_spec.rb
239
+ - spec/controllers/spree/api/v1/zones_controller_spec.rb
239
240
  - spec/fixtures/thinking-cat.jpg
240
241
  - spec/models/spree/legacy_user_spec.rb
241
242
  - spec/requests/rabl_cache_spec.rb
242
243
  - spec/requests/ransackable_attributes_spec.rb
244
+ - spec/requests/version_spec.rb
243
245
  - spec/shared_examples/protect_product_actions.rb
244
246
  - spec/spec_helper.rb
245
247
  - spec/support/controller_hacks.rb
@@ -261,51 +263,52 @@ required_ruby_version: !ruby/object:Gem::Requirement
261
263
  version: '0'
262
264
  required_rubygems_version: !ruby/object:Gem::Requirement
263
265
  requirements:
264
- - - ">="
266
+ - - ">"
265
267
  - !ruby/object:Gem::Version
266
- version: '0'
268
+ version: 1.3.1
267
269
  requirements: []
268
270
  rubyforge_project:
269
- rubygems_version: 2.5.1
271
+ rubygems_version: 2.4.8
270
272
  signing_key:
271
273
  specification_version: 4
272
274
  summary: Spree's API
273
275
  test_files:
274
- - spec/controllers/spree/api/addresses_controller_spec.rb
275
276
  - spec/controllers/spree/api/base_controller_spec.rb
276
- - spec/controllers/spree/api/checkouts_controller_spec.rb
277
- - spec/controllers/spree/api/classifications_controller_spec.rb
278
- - spec/controllers/spree/api/countries_controller_spec.rb
279
- - spec/controllers/spree/api/credit_cards_controller_spec.rb
280
- - spec/controllers/spree/api/images_controller_spec.rb
281
- - spec/controllers/spree/api/inventory_units_controller_spec.rb
282
- - spec/controllers/spree/api/line_items_controller_spec.rb
283
- - spec/controllers/spree/api/option_types_controller_spec.rb
284
- - spec/controllers/spree/api/option_values_controller_spec.rb
285
- - spec/controllers/spree/api/orders_controller_spec.rb
286
- - spec/controllers/spree/api/payments_controller_spec.rb
287
- - spec/controllers/spree/api/product_properties_controller_spec.rb
288
- - spec/controllers/spree/api/products_controller_spec.rb
289
- - spec/controllers/spree/api/promotion_application_spec.rb
290
- - spec/controllers/spree/api/promotions_controller_spec.rb
291
- - spec/controllers/spree/api/properties_controller_spec.rb
292
- - spec/controllers/spree/api/return_authorizations_controller_spec.rb
293
- - spec/controllers/spree/api/shipments_controller_spec.rb
294
- - spec/controllers/spree/api/states_controller_spec.rb
295
- - spec/controllers/spree/api/stock_items_controller_spec.rb
296
- - spec/controllers/spree/api/stock_locations_controller_spec.rb
297
- - spec/controllers/spree/api/stock_movements_controller_spec.rb
298
- - spec/controllers/spree/api/stores_controller_spec.rb
299
- - spec/controllers/spree/api/taxonomies_controller_spec.rb
300
- - spec/controllers/spree/api/taxons_controller_spec.rb
301
- - spec/controllers/spree/api/unauthenticated_products_controller_spec.rb
302
- - spec/controllers/spree/api/users_controller_spec.rb
303
- - spec/controllers/spree/api/variants_controller_spec.rb
304
- - spec/controllers/spree/api/zones_controller_spec.rb
277
+ - spec/controllers/spree/api/v1/addresses_controller_spec.rb
278
+ - spec/controllers/spree/api/v1/checkouts_controller_spec.rb
279
+ - spec/controllers/spree/api/v1/classifications_controller_spec.rb
280
+ - spec/controllers/spree/api/v1/countries_controller_spec.rb
281
+ - spec/controllers/spree/api/v1/credit_cards_controller_spec.rb
282
+ - spec/controllers/spree/api/v1/images_controller_spec.rb
283
+ - spec/controllers/spree/api/v1/inventory_units_controller_spec.rb
284
+ - spec/controllers/spree/api/v1/line_items_controller_spec.rb
285
+ - spec/controllers/spree/api/v1/option_types_controller_spec.rb
286
+ - spec/controllers/spree/api/v1/option_values_controller_spec.rb
287
+ - spec/controllers/spree/api/v1/orders_controller_spec.rb
288
+ - spec/controllers/spree/api/v1/payments_controller_spec.rb
289
+ - spec/controllers/spree/api/v1/product_properties_controller_spec.rb
290
+ - spec/controllers/spree/api/v1/products_controller_spec.rb
291
+ - spec/controllers/spree/api/v1/promotion_application_spec.rb
292
+ - spec/controllers/spree/api/v1/promotions_controller_spec.rb
293
+ - spec/controllers/spree/api/v1/properties_controller_spec.rb
294
+ - spec/controllers/spree/api/v1/return_authorizations_controller_spec.rb
295
+ - spec/controllers/spree/api/v1/shipments_controller_spec.rb
296
+ - spec/controllers/spree/api/v1/states_controller_spec.rb
297
+ - spec/controllers/spree/api/v1/stock_items_controller_spec.rb
298
+ - spec/controllers/spree/api/v1/stock_locations_controller_spec.rb
299
+ - spec/controllers/spree/api/v1/stock_movements_controller_spec.rb
300
+ - spec/controllers/spree/api/v1/stores_controller_spec.rb
301
+ - spec/controllers/spree/api/v1/taxonomies_controller_spec.rb
302
+ - spec/controllers/spree/api/v1/taxons_controller_spec.rb
303
+ - spec/controllers/spree/api/v1/unauthenticated_products_controller_spec.rb
304
+ - spec/controllers/spree/api/v1/users_controller_spec.rb
305
+ - spec/controllers/spree/api/v1/variants_controller_spec.rb
306
+ - spec/controllers/spree/api/v1/zones_controller_spec.rb
305
307
  - spec/fixtures/thinking-cat.jpg
306
308
  - spec/models/spree/legacy_user_spec.rb
307
309
  - spec/requests/rabl_cache_spec.rb
308
310
  - spec/requests/ransackable_attributes_spec.rb
311
+ - spec/requests/version_spec.rb
309
312
  - spec/shared_examples/protect_product_actions.rb
310
313
  - spec/spec_helper.rb
311
314
  - spec/support/controller_hacks.rb