multi-solr 01.07.01 → 01.07.02

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module MultiSolr
2
- VERSION = "01.07.01"
2
+ VERSION = "01.07.02"
3
3
  end
data/lib/multi_solr.rb CHANGED
@@ -5,9 +5,9 @@ require 'active_support/cache'
5
5
  require 'multi_solr/version'
6
6
  require 'multi_solr/solr_filter_simple'
7
7
  require 'multi_solr/solr_filter_collection'
8
+ require 'multi_solr/solr_filter_range'
8
9
  require 'multi_solr/solr_filter_date'
9
10
  require 'multi_solr/solr_filter_date_range'
10
- require 'multi_solr/solr_filter_range'
11
11
  require 'multi_solr/solr_filter_free_query'
12
12
  require 'multi_solr/solr_filter_boolean'
13
13
  require 'multi_solr/filter_value_composite'
@@ -0,0 +1,42 @@
1
+ require 'spec_helper'
2
+ require 'multi_solr/utils'
3
+
4
+ describe MultiSolr::SolrFilterRange do
5
+
6
+ subject{ MultiSolr::SolrFilterRange.new('test') }
7
+
8
+ context 'render_value' do
9
+ it "should return '>= 10' if value from is 10" do
10
+ subject.render_value('test_from' => 10).should == '>=10'
11
+ end
12
+
13
+ it "should return '<= 20' if value to is 20" do
14
+ subject.render_value('test_to' => 20).should == '&lt;=20'
15
+ end
16
+
17
+ it "should return '>=10 und <= 20' if value from is 10 and to is 20" do
18
+ subject.render_value('test_from' => 10, 'test_to' => 20).should == '&gt;=10 und &lt;=20'
19
+ end
20
+
21
+ it "should return empty string if no value given" do
22
+ subject.render_value(nil).should == ''
23
+ subject.render_value({}).should == ''
24
+ end
25
+
26
+ end
27
+
28
+ context 'build_solr_query' do
29
+ it do
30
+ subject.build_solr_query('test_from' => 10).should == 'test:[10 TO *]'
31
+ end
32
+
33
+ it do
34
+ subject.build_solr_query('test_to' => 20).should == 'test:[* TO 20]'
35
+ end
36
+
37
+ it do
38
+ subject.build_solr_query('test_from' => 10, 'test_to' => 20).should == 'test:[10 TO 20]'
39
+ end
40
+ end
41
+
42
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multi-solr
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 7
9
- - 1
10
- version: 01.07.01
9
+ - 2
10
+ version: 01.07.02
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bernd Ledig
@@ -147,6 +147,7 @@ files:
147
147
  - spec/multi_solr/search_result_spec.rb
148
148
  - spec/multi_solr/single_core_handler_spec.rb
149
149
  - spec/multi_solr/solr_filter_boolean_spec.rb
150
+ - spec/multi_solr/solr_filter_range_spec.rb
150
151
  - spec/multi_solr/timeline_core_handler_spec.rb
151
152
  - spec/multi_solr/utils_spec.rb
152
153
  - spec/solr_test_helper.rb