spree_frontend 3.1.1 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4669556dfdb0463ea5912d5f128cbfde9cda8798
|
4
|
+
data.tar.gz: 22c2a185d50f01660afee1207c01e834bd0d99b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15dcb73206f6ed3d17a4f9b223466fc7d07d4fa719dc6c7405ea44eb7bd88ea223f1210d12d498c33cbcf4946e39a0f7b8b02ee9295dfe566bf3cf1c71ce58ee
|
7
|
+
data.tar.gz: 313daef838fcbec9a267f413daf7323ea60f4490efcd6aa26c9702339ea72827ae8003d54b99328442b5e5dd78db50b447413b899b88e6e4aa092c86c6399c50
|
@@ -5,7 +5,8 @@ module Spree
|
|
5
5
|
|
6
6
|
def index
|
7
7
|
@searcher = build_searcher(params.merge(include_images: true))
|
8
|
-
@products = @searcher.retrieve_products
|
8
|
+
@products = @searcher.retrieve_products
|
9
|
+
@products = @products.includes(:possible_promotions) if @products.respond_to?(:includes)
|
9
10
|
@taxonomies = Spree::Taxonomy.includes(root: :children)
|
10
11
|
end
|
11
12
|
end
|
@@ -10,7 +10,8 @@ module Spree
|
|
10
10
|
|
11
11
|
def index
|
12
12
|
@searcher = build_searcher(params.merge(include_images: true))
|
13
|
-
@products = @searcher.retrieve_products
|
13
|
+
@products = @searcher.retrieve_products
|
14
|
+
@products = @products.includes(:possible_promotions) if @products.respond_to?(:includes)
|
14
15
|
@taxonomies = Spree::Taxonomy.includes(root: :children)
|
15
16
|
end
|
16
17
|
|
@@ -24,4 +24,24 @@ describe Spree::HomeController, :type => :controller do
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
27
|
+
|
28
|
+
context "index products" do
|
29
|
+
it "calls includes when the retrieved_products object responds to it" do
|
30
|
+
searcher = double("Searcher")
|
31
|
+
allow(controller).to receive_messages build_searcher: searcher
|
32
|
+
expect(searcher).to receive_message_chain("retrieve_products.includes")
|
33
|
+
|
34
|
+
spree_get :index
|
35
|
+
end
|
36
|
+
|
37
|
+
it "does not call includes when it's not available" do
|
38
|
+
searcher = double("Searcher")
|
39
|
+
allow(controller).to receive_messages build_searcher: searcher
|
40
|
+
allow(searcher).to receive(:retrieve_products).and_return([])
|
41
|
+
|
42
|
+
spree_get :index
|
43
|
+
|
44
|
+
expect(assigns(:products)).to eq([])
|
45
|
+
end
|
46
|
+
end
|
27
47
|
end
|
@@ -64,4 +64,24 @@ describe Spree::ProductsController, :type => :controller do
|
|
64
64
|
expect(response.header["Location"]).to include("taxon_id=#{taxon.id}")
|
65
65
|
end
|
66
66
|
end
|
67
|
+
|
68
|
+
context "index products" do
|
69
|
+
it "calls includes when the retrieved_products object responds to it" do
|
70
|
+
searcher = double("Searcher")
|
71
|
+
allow(controller).to receive_messages build_searcher: searcher
|
72
|
+
expect(searcher).to receive_message_chain("retrieve_products.includes")
|
73
|
+
|
74
|
+
spree_get :index
|
75
|
+
end
|
76
|
+
|
77
|
+
it "does not call includes when it's not available" do
|
78
|
+
searcher = double("Searcher")
|
79
|
+
allow(controller).to receive_messages build_searcher: searcher
|
80
|
+
allow(searcher).to receive(:retrieve_products).and_return([])
|
81
|
+
|
82
|
+
spree_get :index
|
83
|
+
|
84
|
+
expect(assigns(:products)).to eq([])
|
85
|
+
end
|
86
|
+
end
|
67
87
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_frontend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Schofield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree_api
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.1.
|
19
|
+
version: 3.1.2
|
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.1.
|
26
|
+
version: 3.1.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: spree_core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.1.
|
33
|
+
version: 3.1.2
|
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: 3.1.
|
40
|
+
version: 3.1.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bootstrap-sass
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|