plok 1.1.2 → 1.1.3
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 +4 -4
- data/lib/plok/version.rb +1 -1
- data/spec/support/plok/searchable.rb +25 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6267c2e65f2bdf7db8fcefb866007f1dbfa6f283ad481facb47017bad424a05d
|
4
|
+
data.tar.gz: ded3e9ac5159983bd1560b693ba02b312ae7b5f3fce0b100774df30e5e42a18a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 540e8f264ea10b8448edd0547edf00bdd1e807b85182be10c8f5a9a0543c83ca00ed3f56371ee5c34ff6fb268caf287f00673b994c2fc8e093c7fa5eaf7aab05
|
7
|
+
data.tar.gz: 895fb179a873f3789959a36f65c9b0cfddfe83f9003d3320e372545d020baf340ff0464184f6922428748e4a7213c6b2a364dfed4248ebd9ddd04b428f8be643
|
data/lib/plok/version.rb
CHANGED
@@ -9,10 +9,18 @@ shared_examples_for :searchable do
|
|
9
9
|
# Because this is a spec/support included through it_behaves_like,
|
10
10
|
# we have to mock the entry points of the data used in
|
11
11
|
# Plok::Searchable.
|
12
|
-
allow(described_class).to receive(:searchable_fields_list)
|
12
|
+
allow(described_class).to receive(:searchable_fields_list) do
|
13
|
+
{
|
14
|
+
backend: [
|
15
|
+
{ name: :foo, conditions: [] }
|
16
|
+
]
|
17
|
+
}
|
18
|
+
end
|
19
|
+
|
13
20
|
if described_class.respond_to?(:translatable_fields_list)
|
14
21
|
allow(described_class).to receive(:translatable_fields_list) { [] }
|
15
22
|
end
|
23
|
+
|
16
24
|
described_class.define_method(:foo) { 'bar' }
|
17
25
|
end
|
18
26
|
|
@@ -27,7 +35,13 @@ shared_examples_for :searchable do
|
|
27
35
|
|
28
36
|
if described_class.respond_to?(:translatable_fields)
|
29
37
|
before do
|
30
|
-
allow(described_class).to receive(:searchable_fields_list)
|
38
|
+
allow(described_class).to receive(:searchable_fields_list) do
|
39
|
+
{
|
40
|
+
backend: [
|
41
|
+
{ name: :foo, conditions: [] }
|
42
|
+
]
|
43
|
+
}
|
44
|
+
end
|
31
45
|
end
|
32
46
|
|
33
47
|
context 'translatable model' do
|
@@ -62,7 +76,14 @@ shared_examples_for :searchable do
|
|
62
76
|
# Because this is a spec/support included through it_behaves_like,
|
63
77
|
# we have to mock the entry points of the data used in
|
64
78
|
# Plok::Searchable.
|
65
|
-
allow(described_class).to receive(:searchable_fields_list)
|
79
|
+
allow(described_class).to receive(:searchable_fields_list) do
|
80
|
+
{
|
81
|
+
backend: [
|
82
|
+
{ name: :foo, conditions: [] }
|
83
|
+
]
|
84
|
+
}
|
85
|
+
end
|
86
|
+
|
66
87
|
allow_any_subject_of(described_class).to receive(:foo) { 'bar' }
|
67
88
|
allow_any_subject_of(Concerns::Storable::Collection).to receive(:foo) { 'bar' }
|
68
89
|
|
@@ -90,7 +111,7 @@ shared_examples_for :searchable do
|
|
90
111
|
|
91
112
|
it '.respond_to?' do
|
92
113
|
expect(described_class).to respond_to(
|
93
|
-
:
|
114
|
+
:plok_searchable, :searchable_field, :searchable_fields_list
|
94
115
|
)
|
95
116
|
end
|
96
117
|
|