sunspot_matchers 2.2.0.1 → 2.2.0.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: 93ef209cdf1b1551de2677ab1aae74fbecc86c79
|
4
|
+
data.tar.gz: c8ea87d0e981d7c657aab10e163049ac72183fcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a37bd7f78bc341cb1ae84d827ff11596d9791610cfbda858dcac5817e6f29a83f6351ac104bb1e18256eb1a595024474dc584a78a8ff7f99e1fe29cc2b1f5da
|
7
|
+
data.tar.gz: 707f51e7b7d17eb74e68589f4ab8efbc3b2d8bcaf6e3a81ebe7de4b17ac27378a3c86772b509093a0331a643e70d9ab24780e6ada855d81845dd4fec43a89a2e
|
data/Gemfile.lock
CHANGED
data/README.markdown
CHANGED
@@ -93,9 +93,9 @@ block. Keep in mind, that only the expectation type specified as the argument w
|
|
93
93
|
you specify `keywords` and `with` restrictions in the same block, but you said `have_search_params(:keywords, ...`
|
94
94
|
the `with` restrictions are simply ignored.
|
95
95
|
|
96
|
-
Without creative usage of parentheses you can not use do...end blocks to pass multi statement expectations to the matcher
|
97
|
-
though. Because do...end have such a low binding precedent, the block is passed to the wrong method. Curly syntax blocks
|
98
|
-
will work though {...}
|
96
|
+
Without creative usage of parentheses you can not use `do...end` blocks to pass multi statement expectations to the matcher
|
97
|
+
though. Because `do...end` have such a low binding precedent, the block is passed to the wrong method. Curly syntax blocks
|
98
|
+
will work though `{...}`, or you can pass a Proc as the last argument.
|
99
99
|
|
100
100
|
### wildcard matching
|
101
101
|
|
@@ -171,7 +171,7 @@ You can also specify only page or per_page, both are not required.
|
|
171
171
|
|
172
172
|
### :order_by
|
173
173
|
|
174
|
-
|
174
|
+
Standard ordering expectation:
|
175
175
|
|
176
176
|
Sunspot.search(Post) do
|
177
177
|
order_by :published_at, :desc
|
@@ -179,6 +179,18 @@ Expectations on multiple orderings are supported using using the block format me
|
|
179
179
|
|
180
180
|
Sunspot.session.should have_search_params(:order_by, :published_at, :desc)
|
181
181
|
|
182
|
+
Expectations on multiple orderings are supported using using the block format:
|
183
|
+
|
184
|
+
Sunspot.search(Post) do
|
185
|
+
order_by :author_name, :asc
|
186
|
+
order_by :published_at, :desc
|
187
|
+
end
|
188
|
+
|
189
|
+
Sunspot.session.should have_search_params(:order_by) {
|
190
|
+
order_by :author_name, :asc
|
191
|
+
order_by :published_at, :desc
|
192
|
+
}
|
193
|
+
|
182
194
|
### :facet
|
183
195
|
|
184
196
|
Standard faceting expectation:
|
@@ -3,6 +3,9 @@ require 'sunspot_matchers'
|
|
3
3
|
require 'rspec'
|
4
4
|
|
5
5
|
describe SunspotMatchers::HaveDynamicField do
|
6
|
+
class NotALotGoingOn; end
|
7
|
+
class IndexedWithWrongThings; end
|
8
|
+
|
6
9
|
let(:matcher) do
|
7
10
|
described_class.new(:field).tap do |matcher|
|
8
11
|
matcher.matches? klass
|
@@ -10,7 +13,7 @@ describe SunspotMatchers::HaveDynamicField do
|
|
10
13
|
end
|
11
14
|
|
12
15
|
context "when a class has no searchable fields" do
|
13
|
-
let(:klass) { NotALotGoingOn
|
16
|
+
let(:klass) { NotALotGoingOn }
|
14
17
|
|
15
18
|
it "gives Sunspot configuration error" do
|
16
19
|
expect(matcher.failure_message).to match(/Sunspot was not configured/)
|
@@ -18,7 +21,7 @@ describe SunspotMatchers::HaveDynamicField do
|
|
18
21
|
end
|
19
22
|
|
20
23
|
context "when a class has an unexpected searchable field" do
|
21
|
-
let(:klass) { IndexedWithWrongThings
|
24
|
+
let(:klass) { IndexedWithWrongThings }
|
22
25
|
before do
|
23
26
|
Sunspot.setup(klass) { text :parachute }
|
24
27
|
end
|
@@ -3,6 +3,9 @@ require 'sunspot_matchers'
|
|
3
3
|
require 'rspec'
|
4
4
|
|
5
5
|
describe SunspotMatchers::HaveSearchableField do
|
6
|
+
class NotALotGoingOn; end
|
7
|
+
class IndexedWithWrongThings; end
|
8
|
+
|
6
9
|
let(:matcher) do
|
7
10
|
described_class.new(:field).tap do |matcher|
|
8
11
|
matcher.matches? klass
|
@@ -10,7 +13,7 @@ describe SunspotMatchers::HaveSearchableField do
|
|
10
13
|
end
|
11
14
|
|
12
15
|
context "when a class has no searchable fields" do
|
13
|
-
let(:klass) { NotALotGoingOn
|
16
|
+
let(:klass) { NotALotGoingOn }
|
14
17
|
|
15
18
|
it "gives Sunspot configuration error" do
|
16
19
|
expect(matcher.failure_message).to match(/Sunspot was not configured/)
|
@@ -18,7 +21,7 @@ describe SunspotMatchers::HaveSearchableField do
|
|
18
21
|
end
|
19
22
|
|
20
23
|
context "when a class has an unexpected searchable field" do
|
21
|
-
let(:klass) { IndexedWithWrongThings
|
24
|
+
let(:klass) { IndexedWithWrongThings }
|
22
25
|
before do
|
23
26
|
Sunspot.setup(klass) { text :parachute }
|
24
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sunspot_matchers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.0.
|
4
|
+
version: 2.2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joseph Palermo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|