solidus_api 2.5.0.beta1 → 2.5.0.beta2
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0dbdb8e473ea54bf3df9c52158b5a0fc98fc112766f69b397f2aa9f164f94308
|
4
|
+
data.tar.gz: d6662c9adea6b3201733832fdd6c6b678a70c6a8269fe3f157cb3451012dc8cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 965c47bae04883ac829ceb048b18328b85d7be04ba70187a1c824bed38f374cbaa279b4f11dc1037a68730c11bb4ea9de4272004c18a3be9eb46c2dddb9eabc3
|
7
|
+
data.tar.gz: 0d9de4dce48e7b3713f1d0ebca272d3993dbd4b7624bb50f2553ab0902603d79952a54c0fe7732b0bfc00b4a16d9e3682f1c12e79a1f74cd9f7694690944d96c
|
@@ -33,7 +33,7 @@ module Spree
|
|
33
33
|
respond_with(@order, default_template: :show, status: 201)
|
34
34
|
else
|
35
35
|
@order = Spree::Order.create!(user: current_api_user, store: current_store)
|
36
|
-
if
|
36
|
+
if @order.contents.update_cart order_params
|
37
37
|
respond_with(@order, default_template: :show, status: 201)
|
38
38
|
else
|
39
39
|
invalid_resource!(@order)
|
@@ -76,6 +76,20 @@ module Spree
|
|
76
76
|
end
|
77
77
|
end
|
78
78
|
end
|
79
|
+
|
80
|
+
context "with existing promotion" do
|
81
|
+
let(:discount) { 2 }
|
82
|
+
before do
|
83
|
+
create(:promotion, :with_line_item_adjustment, apply_automatically: true, adjustment_rate: discount )
|
84
|
+
end
|
85
|
+
|
86
|
+
it "activates the promotion" do
|
87
|
+
post spree.api_orders_path, params: { order: { line_items: { "0" => { variant_id: variant.to_param, quantity: 1 } } } }
|
88
|
+
order = Order.last
|
89
|
+
line_item = order.line_items.first
|
90
|
+
expect(order.total).to eq(line_item.price - discount)
|
91
|
+
end
|
92
|
+
end
|
79
93
|
end
|
80
94
|
|
81
95
|
context "when the current user can administrate the order" do
|
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.5.0.
|
4
|
+
version: 2.5.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Solidus Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.5.0.
|
19
|
+
version: 2.5.0.beta2
|
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.5.0.
|
26
|
+
version: 2.5.0.beta2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: responders
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -305,7 +305,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
305
305
|
version: 1.8.23
|
306
306
|
requirements: []
|
307
307
|
rubyforge_project:
|
308
|
-
rubygems_version: 2.7.
|
308
|
+
rubygems_version: 2.7.6
|
309
309
|
signing_key:
|
310
310
|
specification_version: 4
|
311
311
|
summary: REST API for the Solidus e-commerce framework.
|