klarna-checkout 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f200d016d1077f2b5b3ebc5f0c86d159026bba2
|
4
|
+
data.tar.gz: e67d945dd337c79bc009dc81f567eb019cd6824f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b761e05e33fc91e2535a89b9c9eb9913873e50ed65d99fe38388bd90677b608f77249b2e1651b4a343bc27683495d9e4ab7dd6bc833163e28de637c6131cd1bd
|
7
|
+
data.tar.gz: d482de6c343129e429961d8876be3ab3fadc07988892c373ba1c49901e3754ce728ab447e26e23214cca6baf77d2213f162767d877639ccb4c42686f3bd303de
|
@@ -5,6 +5,12 @@ module HasMany
|
|
5
5
|
define_method "#{association}=" do |new_value|
|
6
6
|
new_value = Array(new_value)
|
7
7
|
inst_var = "@#{association}"
|
8
|
+
|
9
|
+
if new_value.empty?
|
10
|
+
instance_variable_set(inst_var, [])
|
11
|
+
return
|
12
|
+
end
|
13
|
+
|
8
14
|
case new_value.first
|
9
15
|
when klass
|
10
16
|
instance_variable_set(inst_var, new_value)
|
@@ -11,6 +11,14 @@ describe Klarna::Checkout::Cart do
|
|
11
11
|
it { should have_many(:items, as: Klarna::Checkout::CartItem) }
|
12
12
|
end
|
13
13
|
|
14
|
+
describe "emptying the cart" do
|
15
|
+
before(:each) do
|
16
|
+
subject.items = []
|
17
|
+
end
|
18
|
+
|
19
|
+
its(:items) { should eq [] }
|
20
|
+
end
|
21
|
+
|
14
22
|
describe "#as_json" do
|
15
23
|
let(:cart) do
|
16
24
|
described_class.new \
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: klarna-checkout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Theodor Tonum
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|