sunspot_rails 2.2.7 → 2.2.8
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 +5 -5
- data/.gitignore +1 -2
- data/Appraisals +60 -0
- data/Gemfile +3 -0
- data/gemfiles/.gitkeep +0 -0
- data/lib/sunspot/rails/solr_logging.rb +3 -3
- data/spec/configuration_spec.rb +67 -67
- data/spec/model_lifecycle_spec.rb +8 -8
- data/spec/model_spec.rb +72 -71
- data/spec/rails_app/app/controllers/application_controller.rb +4 -0
- data/spec/rails_app/app/controllers/posts_controller.rb +16 -0
- data/spec/{rails_template → rails_app}/app/models/author.rb +0 -0
- data/spec/{rails_template → rails_app}/app/models/blog.rb +0 -0
- data/spec/{rails_template → rails_app}/app/models/location.rb +0 -0
- data/spec/{rails_template → rails_app}/app/models/photo_post.rb +0 -0
- data/spec/{rails_template → rails_app}/app/models/post.rb +0 -0
- data/spec/{rails_template → rails_app}/app/models/post_with_auto.rb +0 -0
- data/spec/{rails_template → rails_app}/app/models/post_with_default_scope.rb +0 -0
- data/spec/{rails_template → rails_app}/app/models/post_with_only_some_attributes_triggering_reindex.rb +0 -0
- data/spec/{rails_template → rails_app}/app/models/rake_task_auto_load_test_model.rb +0 -0
- data/spec/rails_app/config.ru +4 -0
- data/spec/rails_app/config/application.rb +14 -0
- data/spec/rails_app/config/boot.rb +6 -0
- data/spec/rails_app/config/database.yml +5 -0
- data/spec/rails_app/config/environment.rb +5 -0
- data/spec/rails_app/config/environments/test.rb +38 -0
- data/spec/{rails_template → rails_app}/config/initializers/rails_5_override.rb +0 -0
- data/spec/rails_app/config/initializers/secret_token.rb +1 -0
- data/spec/rails_app/config/initializers/session_store.rb +3 -0
- data/spec/{rails_template → rails_app}/config/routes.rb +0 -0
- data/spec/{rails_template → rails_app}/config/sunspot.yml +0 -0
- data/spec/rails_app/db/schema.rb +26 -0
- data/spec/rake_task_spec.rb +8 -8
- data/spec/request_lifecycle_spec.rb +12 -16
- data/spec/schema.rb +8 -9
- data/spec/searchable_spec.rb +4 -4
- data/spec/server_spec.rb +7 -7
- data/spec/session_spec.rb +3 -3
- data/spec/shared_examples/indexed_after_save.rb +1 -1
- data/spec/shared_examples/not_indexed_after_save.rb +1 -1
- data/spec/spec_helper.rb +18 -51
- data/spec/stub_session_proxy_spec.rb +36 -36
- data/sunspot_rails.gemspec +6 -3
- metadata +94 -58
- data/dev_tasks/spec.rake +0 -97
- data/gemfiles/rails-3.0.0 +0 -21
- data/gemfiles/rails-3.1.0 +0 -21
- data/gemfiles/rails-3.2.0 +0 -21
- data/gemfiles/rails-4.0.0 +0 -25
- data/gemfiles/rails-4.1.0 +0 -24
- data/gemfiles/rails-4.2.0 +0 -24
- data/gemfiles/rails-5.0 +0 -20
- data/spec/rails_template/app/controllers/application_controller.rb +0 -10
- data/spec/rails_template/app/controllers/posts_controller.rb +0 -6
- data/spec/rails_template/config/database.yml +0 -11
- data/spec/rails_template/db/schema.rb +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 846b1e615a854510c5027c97856eba487a2179d38ca0d3be15f89b911cc6fb60
|
4
|
+
data.tar.gz: 46a293fb375ac70062cce75885ad936724df1f5c1888cbda66d60a469841418c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f122dc6d0481e2740a504f3415bc4c00f892cb999c950535f55cf11ed5dc443a8335c09b42543b29bb885805c630896052560e7a83900d9ff0831cd18889dbe
|
7
|
+
data.tar.gz: ee63fcc4578de9c64350f759341aa7296ca521644cdb5cf6bbd82eaaedd2bf47fb2138ebfeac5588f739b453758dddf24fd454d63366eb628ff33854dc5a0795
|
data/.gitignore
CHANGED
data/Appraisals
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
ruby_version = Gem::Version.new(RUBY_VERSION)
|
2
|
+
|
3
|
+
if ruby_version < Gem::Version.new('2.2.0')
|
4
|
+
['3.0.0', '3.1.0'].each do |rails_version|
|
5
|
+
appraise "rails-#{rails_version}" do
|
6
|
+
gem 'sunspot', path: File.expand_path('sunspot', ENV['SUNSPOT_LIB_HOME'])
|
7
|
+
gem 'sunspot_solr', path: File.expand_path('sunspot_solr', ENV['SUNSPOT_LIB_HOME'])
|
8
|
+
gem 'rails', "~> #{rails_version}"
|
9
|
+
gem 'progress_bar', '~> 1.0.5', require: false
|
10
|
+
gem 'rspec', '~> 3.4.0'
|
11
|
+
gem 'rspec-rails', '~> 3.4.0'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
if ruby_version < Gem::Version.new('2.4.0')
|
17
|
+
appraise 'rails-3.2.0' do
|
18
|
+
gem 'sunspot', path: File.expand_path('sunspot', ENV['SUNSPOT_LIB_HOME'])
|
19
|
+
gem 'sunspot_solr', path: File.expand_path('sunspot_solr', ENV['SUNSPOT_LIB_HOME'])
|
20
|
+
gem 'rails', '~> 3.2.0'
|
21
|
+
gem 'progress_bar', '~> 1.0.5', require: false
|
22
|
+
gem 'test-unit', '~> 3.2.0'
|
23
|
+
gem 'rspec', '~> 3.4.0'
|
24
|
+
gem 'rspec-rails', '~> 3.4.0'
|
25
|
+
end
|
26
|
+
|
27
|
+
['4.0.0', '4.1.0'].each do |rails_version|
|
28
|
+
appraise "rails-#{rails_version}" do
|
29
|
+
gem 'sunspot', path: File.expand_path('sunspot', ENV['SUNSPOT_LIB_HOME'])
|
30
|
+
gem 'sunspot_solr', path: File.expand_path('sunspot_solr', ENV['SUNSPOT_LIB_HOME'])
|
31
|
+
gem 'rails', "~> #{rails_version}"
|
32
|
+
gem 'protected_attributes'
|
33
|
+
gem 'progress_bar', '~> 1.0.5', require: false
|
34
|
+
gem 'rspec', '~> 3.4.0'
|
35
|
+
gem 'rspec-rails', '~> 3.4.0'
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
appraise 'rails-4.2.0' do
|
41
|
+
gem 'sunspot', path: File.expand_path('sunspot', ENV['SUNSPOT_LIB_HOME'])
|
42
|
+
gem 'sunspot_solr', path: File.expand_path('sunspot_solr', ENV['SUNSPOT_LIB_HOME'])
|
43
|
+
gem 'rails', '~> 4.2.0'
|
44
|
+
gem 'protected_attributes'
|
45
|
+
gem 'progress_bar', '~> 1.0.5', require: false
|
46
|
+
gem 'rspec', '~> 3.4.0'
|
47
|
+
gem 'rspec-rails', '~> 3.4.0'
|
48
|
+
end
|
49
|
+
|
50
|
+
if ruby_version >= Gem::Version.new('2.2.0')
|
51
|
+
['5.0.0', '5.1.0'].each do |rails_version|
|
52
|
+
appraise "rails-#{rails_version}" do
|
53
|
+
gem 'sunspot', path: File.expand_path('sunspot', ENV['SUNSPOT_LIB_HOME'])
|
54
|
+
gem 'sunspot_solr', path: File.expand_path('sunspot_solr', ENV['SUNSPOT_LIB_HOME'])
|
55
|
+
gem 'rails', "~> #{rails_version}"
|
56
|
+
gem 'protected_attributes_continued'
|
57
|
+
gem 'progress_bar', '~> 1.0.5', require: false
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
data/Gemfile
ADDED
data/gemfiles/.gitkeep
ADDED
File without changes
|
@@ -4,7 +4,7 @@ module Sunspot
|
|
4
4
|
|
5
5
|
COMMIT = %r{<commit/>}
|
6
6
|
|
7
|
-
def execute_with_rails_logging(
|
7
|
+
def execute_with_rails_logging(request_context)
|
8
8
|
body = (request_context[:data]||"").dup
|
9
9
|
action = request_context[:path].capitalize
|
10
10
|
if body =~ COMMIT
|
@@ -16,7 +16,7 @@ module Sunspot
|
|
16
16
|
response = nil
|
17
17
|
begin
|
18
18
|
ms = Benchmark.ms do
|
19
|
-
response = execute_without_rails_logging(
|
19
|
+
response = execute_without_rails_logging(request_context)
|
20
20
|
end
|
21
21
|
log_name = 'Solr %s (%.1fms)' % [action, ms]
|
22
22
|
::Rails.logger.debug(format_log_entry(log_name, body))
|
@@ -47,7 +47,7 @@ module Sunspot
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
RSolr::
|
50
|
+
RSolr::Client.class_eval do
|
51
51
|
include Sunspot::Rails::SolrLogging
|
52
52
|
alias_method :execute_without_rails_logging, :execute
|
53
53
|
alias_method :execute, :execute_with_rails_logging
|
data/spec/configuration_spec.rb
CHANGED
@@ -2,50 +2,50 @@ require File.expand_path('spec_helper', File.dirname(__FILE__))
|
|
2
2
|
|
3
3
|
describe Sunspot::Rails::Configuration, "default values without a sunspot.yml" do
|
4
4
|
before(:each) do
|
5
|
-
File.
|
5
|
+
allow(File).to receive(:exist?).and_return(false) # simulate sunspot.yml not existing
|
6
6
|
@config = Sunspot::Rails::Configuration.new
|
7
7
|
end
|
8
8
|
|
9
9
|
it "should handle the 'hostname' property when not set" do
|
10
|
-
@config.hostname.
|
10
|
+
expect(@config.hostname).to eq('localhost')
|
11
11
|
end
|
12
12
|
|
13
13
|
it "should handle the 'path' property when not set" do
|
14
|
-
@config.path.
|
14
|
+
expect(@config.path).to eq('/solr/default')
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should set the scheme to http" do
|
18
|
-
@config.scheme.
|
18
|
+
expect(@config.scheme).to eq("http")
|
19
19
|
end
|
20
20
|
|
21
21
|
it "should not have userinfo" do
|
22
|
-
@config.userinfo.
|
22
|
+
expect(@config.userinfo).to be_nil
|
23
23
|
end
|
24
24
|
|
25
25
|
it "should not set a proxy" do
|
26
|
-
@config.proxy.
|
26
|
+
expect(@config.proxy).to be_nil
|
27
27
|
end
|
28
28
|
|
29
29
|
describe "port" do
|
30
30
|
it "should default to port 8981 in test" do
|
31
|
-
::Rails.
|
31
|
+
allow(::Rails).to receive(:env).and_return('test')
|
32
32
|
@config = Sunspot::Rails::Configuration.new
|
33
|
-
@config.port.
|
33
|
+
expect(@config.port).to eq(8981)
|
34
34
|
end
|
35
35
|
it "should default to port 8982 in development" do
|
36
|
-
::Rails.
|
36
|
+
allow(::Rails).to receive(:env).and_return('development')
|
37
37
|
@config = Sunspot::Rails::Configuration.new
|
38
|
-
@config.port.
|
38
|
+
expect(@config.port).to eq(8982)
|
39
39
|
end
|
40
40
|
it "should default to 8983 in production" do
|
41
|
-
::Rails.
|
41
|
+
allow(::Rails).to receive(:env).and_return('production')
|
42
42
|
@config = Sunspot::Rails::Configuration.new
|
43
|
-
@config.port.
|
43
|
+
expect(@config.port).to eq(8983)
|
44
44
|
end
|
45
45
|
it "should generally default to 8983" do
|
46
|
-
::Rails.
|
46
|
+
allow(::Rails).to receive(:env).and_return('staging')
|
47
47
|
@config = Sunspot::Rails::Configuration.new
|
48
|
-
@config.port.
|
48
|
+
expect(@config.port).to eq(8983)
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
@@ -58,139 +58,139 @@ describe Sunspot::Rails::Configuration, "default values without a sunspot.yml" d
|
|
58
58
|
end
|
59
59
|
|
60
60
|
it "should set 'log_level' property using Rails log level when not set" do
|
61
|
-
::Rails.logger.
|
62
|
-
@config.log_level.
|
61
|
+
allow(::Rails.logger).to receive(:level){ 3 }
|
62
|
+
expect(@config.log_level).to eq('SEVERE')
|
63
63
|
end
|
64
64
|
|
65
65
|
it "should handle the 'log_file' property" do
|
66
|
-
@config.log_file.
|
66
|
+
expect(@config.log_file).to match(/log\/solr_test.log/)
|
67
67
|
end
|
68
68
|
|
69
69
|
it "should handle the 'solr_home' property when not set" do
|
70
|
-
Rails.
|
71
|
-
@config.solr_home.
|
70
|
+
expect(Rails).to receive(:root).at_least(1).and_return('/some/path')
|
71
|
+
expect(@config.solr_home).to eq('/some/path/solr')
|
72
72
|
end
|
73
73
|
|
74
74
|
it "should handle the 'pid_dir' property when not set" do
|
75
|
-
Rails.
|
76
|
-
@config.pid_dir.
|
75
|
+
expect(Rails).to receive(:root).at_least(1).and_return('/some/path')
|
76
|
+
expect(@config.pid_dir).to eq('/some/path/solr/pids/test')
|
77
77
|
end
|
78
78
|
|
79
79
|
it "should handle the 'auto_commit_after_request' propery when not set" do
|
80
|
-
@config.auto_commit_after_request
|
80
|
+
expect(@config.auto_commit_after_request?).to eq(true)
|
81
81
|
end
|
82
82
|
|
83
83
|
it "should handle the 'auto_commit_after_delete_request' propery when not set" do
|
84
|
-
@config.auto_commit_after_delete_request
|
84
|
+
expect(@config.auto_commit_after_delete_request?).to eq(false)
|
85
85
|
end
|
86
86
|
|
87
87
|
it "should handle the 'bind_address' property when not set" do
|
88
|
-
@config.bind_address.
|
88
|
+
expect(@config.bind_address).to be_nil
|
89
89
|
end
|
90
90
|
|
91
91
|
it "should handle the 'disabled' property when not set" do
|
92
|
-
@config.disabled
|
92
|
+
expect(@config.disabled?).to be_falsey
|
93
93
|
end
|
94
94
|
|
95
95
|
it "should handle the 'auto_index_callback' property when not set" do
|
96
|
-
@config.auto_index_callback.
|
96
|
+
expect(@config.auto_index_callback).to eq("after_save")
|
97
97
|
end
|
98
98
|
|
99
99
|
it "should handle the 'auto_remove_callback' property when not set" do
|
100
|
-
@config.auto_remove_callback.
|
100
|
+
expect(@config.auto_remove_callback).to eq("after_destroy")
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
104
104
|
describe Sunspot::Rails::Configuration, "user provided sunspot.yml" do
|
105
105
|
before(:each) do
|
106
|
-
::Rails.
|
106
|
+
allow(::Rails).to receive(:env).and_return('config_test')
|
107
107
|
@config = Sunspot::Rails::Configuration.new
|
108
108
|
end
|
109
109
|
|
110
110
|
it "should handle the 'scheme' property when set" do
|
111
|
-
@config.scheme.
|
111
|
+
expect(@config.scheme).to eq("http")
|
112
112
|
end
|
113
113
|
|
114
114
|
it "should handle the 'user' and 'pass' properties when set" do
|
115
|
-
@config.userinfo.
|
115
|
+
expect(@config.userinfo).to eq("user:pass")
|
116
116
|
end
|
117
117
|
|
118
118
|
it "should handle the 'hostname' property when set" do
|
119
|
-
@config.hostname.
|
119
|
+
expect(@config.hostname).to eq('some.host')
|
120
120
|
end
|
121
121
|
|
122
122
|
it "should handle the 'port' property when set" do
|
123
|
-
@config.port.
|
123
|
+
expect(@config.port).to eq(1234)
|
124
124
|
end
|
125
125
|
|
126
126
|
it "should handle the 'path' property when set" do
|
127
|
-
@config.path.
|
127
|
+
expect(@config.path).to eq('/solr/idx')
|
128
128
|
end
|
129
129
|
|
130
130
|
it "should handle the 'log_level' propery when set" do
|
131
|
-
@config.log_level.
|
131
|
+
expect(@config.log_level).to eq('WARNING')
|
132
132
|
end
|
133
133
|
|
134
134
|
it "should handle the 'solr_home' propery when set" do
|
135
|
-
@config.solr_home.
|
135
|
+
expect(@config.solr_home).to eq('/my_superior_path')
|
136
136
|
end
|
137
137
|
|
138
138
|
it "should handle the 'pid_dir' property when set" do
|
139
|
-
@config.pid_dir.
|
139
|
+
expect(@config.pid_dir).to eq('/my_superior_path/pids')
|
140
140
|
end
|
141
141
|
|
142
142
|
it "should handle the 'solr_home' property when set" do
|
143
|
-
@config.solr_home.
|
143
|
+
expect(@config.solr_home).to eq('/my_superior_path')
|
144
144
|
end
|
145
145
|
|
146
146
|
it "should handle the 'auto_commit_after_request' propery when set" do
|
147
|
-
@config.auto_commit_after_request
|
147
|
+
expect(@config.auto_commit_after_request?).to eq(false)
|
148
148
|
end
|
149
149
|
|
150
150
|
it "should handle the 'auto_commit_after_delete_request' propery when set" do
|
151
|
-
@config.auto_commit_after_delete_request
|
151
|
+
expect(@config.auto_commit_after_delete_request?).to eq(true)
|
152
152
|
end
|
153
153
|
|
154
154
|
it "should handle the 'bind_address' property when set" do
|
155
|
-
@config.bind_address.
|
155
|
+
expect(@config.bind_address).to eq("127.0.0.1")
|
156
156
|
end
|
157
157
|
|
158
158
|
it "should handle the 'read_timeout' property when set" do
|
159
|
-
@config.read_timeout.
|
159
|
+
expect(@config.read_timeout).to eq(2)
|
160
160
|
end
|
161
161
|
|
162
162
|
it "should handle the 'open_timeout' property when set" do
|
163
|
-
@config.open_timeout.
|
163
|
+
expect(@config.open_timeout).to eq(0.5)
|
164
164
|
end
|
165
165
|
|
166
166
|
it "should handle the 'proxy' property when set" do
|
167
|
-
@config.proxy.
|
167
|
+
expect(@config.proxy).to eq('http://proxy.com:12345')
|
168
168
|
end
|
169
169
|
end
|
170
170
|
|
171
171
|
describe Sunspot::Rails::Configuration, "with auto_index_callback and auto_remove_callback set" do
|
172
172
|
before do
|
173
|
-
::Rails.
|
173
|
+
allow(::Rails).to receive(:env).and_return('config_commit_test')
|
174
174
|
@config = Sunspot::Rails::Configuration.new
|
175
175
|
end
|
176
176
|
|
177
177
|
it "should handle the 'auto_index_callback' property when set" do
|
178
|
-
@config.auto_index_callback.
|
178
|
+
expect(@config.auto_index_callback).to eq("after_commit")
|
179
179
|
end
|
180
180
|
|
181
181
|
it "should handle the 'auto_remove_callback' property when set" do
|
182
|
-
@config.auto_remove_callback.
|
182
|
+
expect(@config.auto_remove_callback).to eq("after_commit")
|
183
183
|
end
|
184
184
|
end
|
185
185
|
|
186
186
|
describe Sunspot::Rails::Configuration, "with disabled: true in sunspot.yml" do
|
187
187
|
before(:each) do
|
188
|
-
::Rails.
|
188
|
+
allow(::Rails).to receive(:env).and_return('config_disabled_test')
|
189
189
|
@config = Sunspot::Rails::Configuration.new
|
190
190
|
end
|
191
191
|
|
192
192
|
it "should handle the 'disabled' property when set" do
|
193
|
-
@config.disabled
|
193
|
+
expect(@config.disabled?).to be_truthy
|
194
194
|
end
|
195
195
|
end
|
196
196
|
|
@@ -200,7 +200,7 @@ describe Sunspot::Rails::Configuration, "with ENV['SOLR_URL'] overriding sunspot
|
|
200
200
|
end
|
201
201
|
|
202
202
|
before(:each) do
|
203
|
-
::Rails.
|
203
|
+
allow(::Rails).to receive(:env).and_return('config_test')
|
204
204
|
@config = Sunspot::Rails::Configuration.new
|
205
205
|
end
|
206
206
|
|
@@ -209,15 +209,15 @@ describe Sunspot::Rails::Configuration, "with ENV['SOLR_URL'] overriding sunspot
|
|
209
209
|
end
|
210
210
|
|
211
211
|
it "should handle the 'hostname' property when set" do
|
212
|
-
@config.hostname.
|
212
|
+
expect(@config.hostname).to eq('environment.host')
|
213
213
|
end
|
214
214
|
|
215
215
|
it "should handle the 'port' property when set" do
|
216
|
-
@config.port.
|
216
|
+
expect(@config.port).to eq(5432)
|
217
217
|
end
|
218
218
|
|
219
219
|
it "should handle the 'path' property when set" do
|
220
|
-
@config.path.
|
220
|
+
expect(@config.path).to eq('/solr/env')
|
221
221
|
end
|
222
222
|
end
|
223
223
|
|
@@ -227,7 +227,7 @@ describe Sunspot::Rails::Configuration, "with ENV['WEBSOLR_URL'] overriding suns
|
|
227
227
|
end
|
228
228
|
|
229
229
|
before(:each) do
|
230
|
-
::Rails.
|
230
|
+
allow(::Rails).to receive(:env).and_return('config_test')
|
231
231
|
@config = Sunspot::Rails::Configuration.new
|
232
232
|
end
|
233
233
|
|
@@ -236,15 +236,15 @@ describe Sunspot::Rails::Configuration, "with ENV['WEBSOLR_URL'] overriding suns
|
|
236
236
|
end
|
237
237
|
|
238
238
|
it "should handle the 'hostname' property when set" do
|
239
|
-
@config.hostname.
|
239
|
+
expect(@config.hostname).to eq('index.websolr.test')
|
240
240
|
end
|
241
241
|
|
242
242
|
it "should handle the 'port' property when set" do
|
243
|
-
@config.port.
|
243
|
+
expect(@config.port).to eq(80)
|
244
244
|
end
|
245
245
|
|
246
246
|
it "should handle the 'path' property when set" do
|
247
|
-
@config.path.
|
247
|
+
expect(@config.path).to eq('/solr/a1b2c3d4e5f')
|
248
248
|
end
|
249
249
|
end
|
250
250
|
|
@@ -254,7 +254,7 @@ describe Sunspot::Rails::Configuration, "with ENV['WEBSOLR_URL'] using https" do
|
|
254
254
|
end
|
255
255
|
|
256
256
|
before(:each) do
|
257
|
-
::Rails.
|
257
|
+
allow(::Rails).to receive(:env).and_return('config_test')
|
258
258
|
@config = Sunspot::Rails::Configuration.new
|
259
259
|
end
|
260
260
|
|
@@ -263,19 +263,19 @@ describe Sunspot::Rails::Configuration, "with ENV['WEBSOLR_URL'] using https" do
|
|
263
263
|
end
|
264
264
|
|
265
265
|
it "should set the scheme to https" do
|
266
|
-
@config.scheme.
|
266
|
+
expect(@config.scheme).to eq("https")
|
267
267
|
end
|
268
268
|
|
269
269
|
it "should handle the 'hostname' property when set" do
|
270
|
-
@config.hostname.
|
270
|
+
expect(@config.hostname).to eq('index.websolr.test')
|
271
271
|
end
|
272
272
|
|
273
273
|
it "should handle the 'port' property when set" do
|
274
|
-
@config.port.
|
274
|
+
expect(@config.port).to eq(443)
|
275
275
|
end
|
276
276
|
|
277
277
|
it "should handle the 'path' property when set" do
|
278
|
-
@config.path.
|
278
|
+
expect(@config.path).to eq('/solr/a1b2c3d4e5f')
|
279
279
|
end
|
280
280
|
end
|
281
281
|
|
@@ -285,7 +285,7 @@ describe Sunspot::Rails::Configuration, "with ENV['WEBSOLR_URL'] including useri
|
|
285
285
|
end
|
286
286
|
|
287
287
|
before(:each) do
|
288
|
-
::Rails.
|
288
|
+
allow(::Rails).to receive(:env).and_return('config_test')
|
289
289
|
@config = Sunspot::Rails::Configuration.new
|
290
290
|
end
|
291
291
|
|
@@ -294,22 +294,22 @@ describe Sunspot::Rails::Configuration, "with ENV['WEBSOLR_URL'] including useri
|
|
294
294
|
end
|
295
295
|
|
296
296
|
it "should include username and passowrd" do
|
297
|
-
@config.userinfo.
|
297
|
+
expect(@config.userinfo).to eq("user:pass")
|
298
298
|
end
|
299
299
|
|
300
300
|
it "should set the scheme to https" do
|
301
|
-
@config.scheme.
|
301
|
+
expect(@config.scheme).to eq("https")
|
302
302
|
end
|
303
303
|
|
304
304
|
it "should handle the 'hostname' property when set" do
|
305
|
-
@config.hostname.
|
305
|
+
expect(@config.hostname).to eq('index.websolr.test')
|
306
306
|
end
|
307
307
|
|
308
308
|
it "should handle the 'port' property when set" do
|
309
|
-
@config.port.
|
309
|
+
expect(@config.port).to eq(443)
|
310
310
|
end
|
311
311
|
|
312
312
|
it "should handle the 'path' property when set" do
|
313
|
-
@config.path.
|
313
|
+
expect(@config.path).to eq('/solr/a1b2c3d4e5f')
|
314
314
|
end
|
315
315
|
end
|