spree_api 2.2.2 → 2.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/spree/api/checkouts_controller.rb +0 -4
- data/app/controllers/spree/api/option_values_controller.rb +1 -1
- data/app/controllers/spree/api/shipments_controller.rb +0 -10
- data/app/views/spree/api/addresses/show.v1.rabl +1 -1
- data/app/views/spree/api/adjustments/show.v1.rabl +2 -2
- data/app/views/spree/api/credit_cards/show.v1.rabl +2 -2
- data/app/views/spree/api/line_items/show.v1.rabl +1 -1
- data/app/views/spree/api/orders/order.v1.rabl +1 -1
- data/app/views/spree/api/products/show.v1.rabl +1 -1
- data/app/views/spree/api/shipments/show.v1.rabl +1 -1
- data/app/views/spree/api/variants/big.v1.rabl +1 -1
- data/app/views/spree/api/variants/show.v1.rabl +1 -1
- data/app/views/spree/api/variants/small.v1.rabl +1 -1
- data/spec/controllers/spree/api/option_values_controller_spec.rb +7 -0
- data/spec/controllers/spree/api/orders_controller_spec.rb +17 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 023d49b32c382f815538ecd352d5aa66023229b1
|
4
|
+
data.tar.gz: ecab512bc91356f7caa6f885330b2d1f6bb15989
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55274ba4edc914b51eb726c77315569083b6cfa33d1a0758dba5002bc6a3d643a0f883179e42b3f3c19aa364696ec6590da2815cbb9bc75214ce07a79da5afbc
|
7
|
+
data.tar.gz: cdab9a3906f0919a652e3de59ab59d100da401170a8cbbe3ae5441b2880fc43b8caad2905e53a42155bbf1b04ffc7a0bcc55eb6c7eebfa8297c1883e870871e5
|
@@ -106,10 +106,6 @@ module Spree
|
|
106
106
|
send(method_name) if respond_to?(method_name, true)
|
107
107
|
end
|
108
108
|
|
109
|
-
def before_payment
|
110
|
-
@order.payments.destroy_all if request.put?
|
111
|
-
end
|
112
|
-
|
113
109
|
def next!(options={})
|
114
110
|
if @order.valid? && @order.next
|
115
111
|
render 'spree/api/orders/show', status: options[:status] || 200
|
@@ -30,18 +30,8 @@ module Spree
|
|
30
30
|
@shipment = Spree::Shipment.accessible_by(current_ability, :update).readonly(false).find_by!(number: params[:id])
|
31
31
|
end
|
32
32
|
|
33
|
-
unlock = params[:shipment].delete(:unlock)
|
34
|
-
|
35
|
-
if unlock == 'yes'
|
36
|
-
@shipment.adjustment.open
|
37
|
-
end
|
38
|
-
|
39
33
|
@shipment.update_attributes(shipment_params)
|
40
34
|
|
41
|
-
if unlock == 'yes'
|
42
|
-
@shipment.adjustment.close
|
43
|
-
end
|
44
|
-
|
45
35
|
@shipment.reload
|
46
36
|
respond_with(@shipment, default_template: :show)
|
47
37
|
end
|
@@ -1,3 +1,3 @@
|
|
1
1
|
object @credit_card
|
2
|
-
cache
|
3
|
-
attributes *creditcard_attributes
|
2
|
+
cache [I18n.locale, root_object]
|
3
|
+
attributes *creditcard_attributes
|
@@ -111,6 +111,13 @@ module Spree
|
|
111
111
|
option_value.name.should == "Option Value"
|
112
112
|
end
|
113
113
|
|
114
|
+
it "permits the correct attributes" do
|
115
|
+
controller.should_receive(:permitted_option_value_attributes)
|
116
|
+
api_put :update, :id => option_value.id, :option_value => {
|
117
|
+
:name => ""
|
118
|
+
}
|
119
|
+
end
|
120
|
+
|
114
121
|
it "cannot update an option value with invalid attributes" do
|
115
122
|
api_put :update, :id => option_value.id, :option_value => {
|
116
123
|
:name => ""
|
@@ -475,6 +475,23 @@ module Spree
|
|
475
475
|
expect(updated_at.split("T").last).to have_content(milisecond)
|
476
476
|
end
|
477
477
|
|
478
|
+
context "caching enabled" do
|
479
|
+
before do
|
480
|
+
ActionController::Base.perform_caching = true
|
481
|
+
3.times { Order.create }
|
482
|
+
end
|
483
|
+
|
484
|
+
it "returns unique orders" do
|
485
|
+
api_get :index
|
486
|
+
|
487
|
+
orders = json_response["orders"]
|
488
|
+
expect(orders.count).to be >= 3
|
489
|
+
expect(orders.map { |o| o["id"] }.sort).to eq(Order.order(:id).pluck(:id))
|
490
|
+
end
|
491
|
+
|
492
|
+
after { ActionController::Base.perform_caching = false }
|
493
|
+
end
|
494
|
+
|
478
495
|
context "with two orders" do
|
479
496
|
before { create(:order) }
|
480
497
|
|
@@ -549,4 +566,3 @@ module Spree
|
|
549
566
|
end
|
550
567
|
end
|
551
568
|
end
|
552
|
-
|
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: 2.2.
|
4
|
+
version: 2.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Bigg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree_core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.2.
|
19
|
+
version: 2.2.3
|
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.2.
|
26
|
+
version: 2.2.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rabl
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -254,7 +254,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
254
254
|
version: '0'
|
255
255
|
requirements: []
|
256
256
|
rubyforge_project:
|
257
|
-
rubygems_version: 2.2.
|
257
|
+
rubygems_version: 2.2.2
|
258
258
|
signing_key:
|
259
259
|
specification_version: 4
|
260
260
|
summary: Spree's API
|