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.
Files changed (56) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -2
  3. data/Appraisals +60 -0
  4. data/Gemfile +3 -0
  5. data/gemfiles/.gitkeep +0 -0
  6. data/lib/sunspot/rails/solr_logging.rb +3 -3
  7. data/spec/configuration_spec.rb +67 -67
  8. data/spec/model_lifecycle_spec.rb +8 -8
  9. data/spec/model_spec.rb +72 -71
  10. data/spec/rails_app/app/controllers/application_controller.rb +4 -0
  11. data/spec/rails_app/app/controllers/posts_controller.rb +16 -0
  12. data/spec/{rails_template → rails_app}/app/models/author.rb +0 -0
  13. data/spec/{rails_template → rails_app}/app/models/blog.rb +0 -0
  14. data/spec/{rails_template → rails_app}/app/models/location.rb +0 -0
  15. data/spec/{rails_template → rails_app}/app/models/photo_post.rb +0 -0
  16. data/spec/{rails_template → rails_app}/app/models/post.rb +0 -0
  17. data/spec/{rails_template → rails_app}/app/models/post_with_auto.rb +0 -0
  18. data/spec/{rails_template → rails_app}/app/models/post_with_default_scope.rb +0 -0
  19. data/spec/{rails_template → rails_app}/app/models/post_with_only_some_attributes_triggering_reindex.rb +0 -0
  20. data/spec/{rails_template → rails_app}/app/models/rake_task_auto_load_test_model.rb +0 -0
  21. data/spec/rails_app/config.ru +4 -0
  22. data/spec/rails_app/config/application.rb +14 -0
  23. data/spec/rails_app/config/boot.rb +6 -0
  24. data/spec/rails_app/config/database.yml +5 -0
  25. data/spec/rails_app/config/environment.rb +5 -0
  26. data/spec/rails_app/config/environments/test.rb +38 -0
  27. data/spec/{rails_template → rails_app}/config/initializers/rails_5_override.rb +0 -0
  28. data/spec/rails_app/config/initializers/secret_token.rb +1 -0
  29. data/spec/rails_app/config/initializers/session_store.rb +3 -0
  30. data/spec/{rails_template → rails_app}/config/routes.rb +0 -0
  31. data/spec/{rails_template → rails_app}/config/sunspot.yml +0 -0
  32. data/spec/rails_app/db/schema.rb +26 -0
  33. data/spec/rake_task_spec.rb +8 -8
  34. data/spec/request_lifecycle_spec.rb +12 -16
  35. data/spec/schema.rb +8 -9
  36. data/spec/searchable_spec.rb +4 -4
  37. data/spec/server_spec.rb +7 -7
  38. data/spec/session_spec.rb +3 -3
  39. data/spec/shared_examples/indexed_after_save.rb +1 -1
  40. data/spec/shared_examples/not_indexed_after_save.rb +1 -1
  41. data/spec/spec_helper.rb +18 -51
  42. data/spec/stub_session_proxy_spec.rb +36 -36
  43. data/sunspot_rails.gemspec +6 -3
  44. metadata +94 -58
  45. data/dev_tasks/spec.rake +0 -97
  46. data/gemfiles/rails-3.0.0 +0 -21
  47. data/gemfiles/rails-3.1.0 +0 -21
  48. data/gemfiles/rails-3.2.0 +0 -21
  49. data/gemfiles/rails-4.0.0 +0 -25
  50. data/gemfiles/rails-4.1.0 +0 -24
  51. data/gemfiles/rails-4.2.0 +0 -24
  52. data/gemfiles/rails-5.0 +0 -20
  53. data/spec/rails_template/app/controllers/application_controller.rb +0 -10
  54. data/spec/rails_template/app/controllers/posts_controller.rb +0 -6
  55. data/spec/rails_template/config/database.yml +0 -11
  56. data/spec/rails_template/db/schema.rb +0 -27
@@ -13,108 +13,108 @@ describe 'specs with Sunspot stubbed' do
13
13
  foo = double('Foo')
14
14
  block = lambda { foo.bar }
15
15
 
16
- foo.should_receive(:bar)
16
+ expect(foo).to receive(:bar)
17
17
 
18
18
  Sunspot.batch(&block)
19
19
  end
20
20
 
21
21
  it 'should not send index to session' do
22
- @session.should_not_receive(:index)
22
+ expect(@session).not_to receive(:index)
23
23
  @post.index
24
24
  end
25
25
 
26
26
  it 'should not send index! to session' do
27
- @session.should_not_receive(:index!)
27
+ expect(@session).not_to receive(:index!)
28
28
  @post.index!
29
29
  end
30
30
 
31
31
  it 'should not send atomic_update to session' do
32
- @session.should_not_receive(:atomic_update)
32
+ expect(@session).not_to receive(:atomic_update)
33
33
  @post.index
34
34
  end
35
35
 
36
36
  it 'should not send atomic_update! to session' do
37
- @session.should_not_receive(:atomic_update!)
37
+ expect(@session).not_to receive(:atomic_update!)
38
38
  @post.index!
39
39
  end
40
40
 
41
41
  it 'should not send commit to session' do
42
- @session.should_not_receive(:commit)
42
+ expect(@session).not_to receive(:commit)
43
43
  Sunspot.commit
44
44
  end
45
45
 
46
46
  it 'should not send remove to session' do
47
- @session.should_not_receive(:remove)
47
+ expect(@session).not_to receive(:remove)
48
48
  @post.remove_from_index
49
49
  end
50
50
 
51
51
  it 'should not send remove! to session' do
52
- @session.should_not_receive(:remove)
52
+ expect(@session).not_to receive(:remove)
53
53
  @post.remove_from_index!
54
54
  end
55
55
 
56
56
  it 'should not send remove_by_id to session' do
57
- @session.should_not_receive(:remove_by_id)
57
+ expect(@session).not_to receive(:remove_by_id)
58
58
  Sunspot.remove_by_id(Post, 1)
59
59
  end
60
60
 
61
61
  it 'should not send remove_by_id! to session' do
62
- @session.should_not_receive(:remove_by_id!)
62
+ expect(@session).not_to receive(:remove_by_id!)
63
63
  Sunspot.remove_by_id!(Post, 1)
64
64
  end
65
65
 
66
66
  it 'should not send remove_all to session' do
67
- @session.should_not_receive(:remove_all)
67
+ expect(@session).not_to receive(:remove_all)
68
68
  Post.remove_all_from_index
69
69
  end
70
70
 
71
71
  it 'should not send remove_all! to session' do
72
- @session.should_not_receive(:remove_all!)
72
+ expect(@session).not_to receive(:remove_all!)
73
73
  Post.remove_all_from_index!
74
74
  end
75
75
 
76
76
  it 'should not send optimize to session' do
77
- @session.should_not_receive(:optimize)
77
+ expect(@session).not_to receive(:optimize)
78
78
  Sunspot.optimize
79
79
  end
80
80
 
81
81
  it 'should return false for dirty?' do
82
- @session.should_not_receive(:dirty?)
83
- Sunspot.dirty?.should == false
82
+ expect(@session).not_to receive(:dirty?)
83
+ expect(Sunspot.dirty?).to eq(false)
84
84
  end
85
85
 
86
86
  it 'should not send commit_if_dirty to session' do
87
- @session.should_not_receive(:commit_if_dirty)
87
+ expect(@session).not_to receive(:commit_if_dirty)
88
88
  Sunspot.commit_if_dirty
89
89
  end
90
90
 
91
91
  it 'should return false for delete_dirty?' do
92
- @session.should_not_receive(:delete_dirty?)
93
- Sunspot.delete_dirty?.should == false
92
+ expect(@session).not_to receive(:delete_dirty?)
93
+ expect(Sunspot.delete_dirty?).to eq(false)
94
94
  end
95
95
 
96
96
  it 'should not send commit_if_delete_dirty to session' do
97
- @session.should_not_receive(:commit_if_delete_dirty)
97
+ expect(@session).not_to receive(:commit_if_delete_dirty)
98
98
  Sunspot.commit_if_delete_dirty
99
99
  end
100
100
 
101
101
  it 'should not execute a search when #search called' do
102
- @session.should_not_receive(:search)
102
+ expect(@session).not_to receive(:search)
103
103
  Post.search
104
104
  end
105
105
 
106
106
  it 'should not execute a search when #search called with parameters' do
107
- @session.should_not_receive(:search)
107
+ expect(@session).not_to receive(:search)
108
108
  Post.search(:include => :blog, :select => 'id, title')
109
109
  end
110
110
 
111
111
  it 'should return a new search' do
112
- @session.should_not_receive(:new_search)
113
- Sunspot.new_search(Post).should respond_to(:execute)
112
+ expect(@session).not_to receive(:new_search)
113
+ expect(Sunspot.new_search(Post)).to respond_to(:execute)
114
114
  end
115
115
 
116
116
  it 'should not send more_like_this to session' do
117
- @session.should_not_receive(:more_like_this)
117
+ expect(@session).not_to receive(:more_like_this)
118
118
  Sunspot.more_like_this(@post)
119
119
  end
120
120
 
@@ -124,31 +124,31 @@ describe 'specs with Sunspot stubbed' do
124
124
  end
125
125
 
126
126
  it 'should return empty results' do
127
- @search.results.should == []
127
+ expect(@search.results).to eq([])
128
128
  end
129
129
 
130
130
  it 'should return empty hits' do
131
- @search.hits.should == []
131
+ expect(@search.hits).to eq([])
132
132
  end
133
133
 
134
134
  it 'should return the same for raw_results as hits' do
135
- @search.raw_results.should == @search.hits
135
+ expect(@search.raw_results).to eq(@search.hits)
136
136
  end
137
137
 
138
138
  it 'should return zero total' do
139
- @search.total.should == 0
139
+ expect(@search.total).to eq(0)
140
140
  end
141
141
 
142
142
  it 'should return empty results for a given facet' do
143
- @search.facet(:category_id).rows.should == []
143
+ expect(@search.facet(:category_id).rows).to eq([])
144
144
  end
145
145
 
146
146
  it 'should return empty results for a given dynamic facet' do
147
- @search.dynamic_facet(:custom).rows.should == []
147
+ expect(@search.dynamic_facet(:custom).rows).to eq([])
148
148
  end
149
149
 
150
150
  it 'should return empty array if listing facets' do
151
- @search.facets.should == []
151
+ expect(@search.facets).to eq([])
152
152
  end
153
153
 
154
154
  describe '#data_accessor_for' do
@@ -157,11 +157,11 @@ describe 'specs with Sunspot stubbed' do
157
157
  end
158
158
 
159
159
  it 'should provide accessor for select' do
160
- @accessor.should respond_to(:select, :select=)
160
+ expect(@accessor).to respond_to(:select, :select=)
161
161
  end
162
162
 
163
163
  it 'should provide accessor for include' do
164
- @accessor.should respond_to(:include, :include=)
164
+ expect(@accessor).to respond_to(:include, :include=)
165
165
  end
166
166
  end
167
167
 
@@ -171,7 +171,7 @@ describe 'specs with Sunspot stubbed' do
171
171
  end
172
172
 
173
173
  it 'should response to all the available data methods' do
174
- @stats.should respond_to(
174
+ expect(@stats).to respond_to(
175
175
  :min,
176
176
  :max,
177
177
  :count,
@@ -183,11 +183,11 @@ describe 'specs with Sunspot stubbed' do
183
183
  end
184
184
 
185
185
  it 'should return empty results for a given facet' do
186
- @stats.facet(:category_id).rows.should == []
186
+ expect(@stats.facet(:category_id).rows).to eq([])
187
187
  end
188
188
 
189
189
  it 'should return empty array if listing facets' do
190
- @stats.facets.should == []
190
+ expect(@stats.facets).to eq([])
191
191
  end
192
192
 
193
193
  end
@@ -34,10 +34,13 @@ Gem::Specification.new do |s|
34
34
 
35
35
  s.add_dependency 'rails', '>= 3'
36
36
  s.add_dependency 'sunspot', Sunspot::VERSION
37
- s.add_dependency 'nokogiri'
38
37
 
39
- s.add_development_dependency 'rspec', '~> 1.2'
40
- s.add_development_dependency 'rspec-rails', '~> 1.2'
38
+ s.add_development_dependency 'appraisal', '2.2.0'
39
+ s.add_development_dependency 'nokogiri', '< 1.7' if RUBY_VERSION <= '2.0.0'
40
+ s.add_development_dependency 'rake', '< 12.3'
41
+ s.add_development_dependency 'rspec'
42
+ s.add_development_dependency 'rspec-rails'
43
+ s.add_development_dependency 'sqlite3'
41
44
 
42
45
  s.rdoc_options << '--webcvs=http://github.com/outoftime/sunspot/tree/master/%s' <<
43
46
  '--title' << 'Sunspot-Rails - Rails integration for the Sunspot Solr search library - API Documentation' <<
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sunspot_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.7
4
+ version: 2.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mat Brown
@@ -26,7 +26,7 @@ authors:
26
26
  autorequire:
27
27
  bindir: bin
28
28
  cert_chain: []
29
- date: 2016-10-26 00:00:00.000000000 Z
29
+ date: 2018-03-26 00:00:00.000000000 Z
30
30
  dependencies:
31
31
  - !ruby/object:Gem::Dependency
32
32
  name: rails
@@ -48,22 +48,50 @@ dependencies:
48
48
  requirements:
49
49
  - - '='
50
50
  - !ruby/object:Gem::Version
51
- version: 2.2.7
51
+ version: 2.2.8
52
52
  type: :runtime
53
53
  prerelease: false
54
54
  version_requirements: !ruby/object:Gem::Requirement
55
55
  requirements:
56
56
  - - '='
57
57
  - !ruby/object:Gem::Version
58
- version: 2.2.7
58
+ version: 2.2.8
59
59
  - !ruby/object:Gem::Dependency
60
- name: nokogiri
60
+ name: appraisal
61
+ requirement: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - '='
64
+ - !ruby/object:Gem::Version
65
+ version: 2.2.0
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - '='
71
+ - !ruby/object:Gem::Version
72
+ version: 2.2.0
73
+ - !ruby/object:Gem::Dependency
74
+ name: rake
75
+ requirement: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - "<"
78
+ - !ruby/object:Gem::Version
79
+ version: '12.3'
80
+ type: :development
81
+ prerelease: false
82
+ version_requirements: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - "<"
85
+ - !ruby/object:Gem::Version
86
+ version: '12.3'
87
+ - !ruby/object:Gem::Dependency
88
+ name: rspec
61
89
  requirement: !ruby/object:Gem::Requirement
62
90
  requirements:
63
91
  - - ">="
64
92
  - !ruby/object:Gem::Version
65
93
  version: '0'
66
- type: :runtime
94
+ type: :development
67
95
  prerelease: false
68
96
  version_requirements: !ruby/object:Gem::Requirement
69
97
  requirements:
@@ -71,33 +99,33 @@ dependencies:
71
99
  - !ruby/object:Gem::Version
72
100
  version: '0'
73
101
  - !ruby/object:Gem::Dependency
74
- name: rspec
102
+ name: rspec-rails
75
103
  requirement: !ruby/object:Gem::Requirement
76
104
  requirements:
77
- - - "~>"
105
+ - - ">="
78
106
  - !ruby/object:Gem::Version
79
- version: '1.2'
107
+ version: '0'
80
108
  type: :development
81
109
  prerelease: false
82
110
  version_requirements: !ruby/object:Gem::Requirement
83
111
  requirements:
84
- - - "~>"
112
+ - - ">="
85
113
  - !ruby/object:Gem::Version
86
- version: '1.2'
114
+ version: '0'
87
115
  - !ruby/object:Gem::Dependency
88
- name: rspec-rails
116
+ name: sqlite3
89
117
  requirement: !ruby/object:Gem::Requirement
90
118
  requirements:
91
- - - "~>"
119
+ - - ">="
92
120
  - !ruby/object:Gem::Version
93
- version: '1.2'
121
+ version: '0'
94
122
  type: :development
95
123
  prerelease: false
96
124
  version_requirements: !ruby/object:Gem::Requirement
97
125
  requirements:
98
- - - "~>"
126
+ - - ">="
99
127
  - !ruby/object:Gem::Version
100
- version: '1.2'
128
+ version: '0'
101
129
  description: |2
102
130
  Sunspot::Rails is an extension to the Sunspot library for Solr search.
103
131
  Sunspot::Rails adds integration between Sunspot and ActiveRecord, including
@@ -113,6 +141,8 @@ extra_rdoc_files: []
113
141
  files:
114
142
  - ".gitignore"
115
143
  - ".rspec"
144
+ - Appraisals
145
+ - Gemfile
116
146
  - History.txt
117
147
  - LICENSE
118
148
  - MIT-LICENSE
@@ -121,15 +151,8 @@ files:
121
151
  - TODO
122
152
  - dev_tasks/rdoc.rake
123
153
  - dev_tasks/release.rake
124
- - dev_tasks/spec.rake
125
154
  - dev_tasks/todo.rake
126
- - gemfiles/rails-3.0.0
127
- - gemfiles/rails-3.1.0
128
- - gemfiles/rails-3.2.0
129
- - gemfiles/rails-4.0.0
130
- - gemfiles/rails-4.1.0
131
- - gemfiles/rails-4.2.0
132
- - gemfiles/rails-5.0
155
+ - gemfiles/.gitkeep
133
156
  - generators/sunspot/sunspot_generator.rb
134
157
  - generators/sunspot/templates/sunspot.yml
135
158
  - install.rb
@@ -155,22 +178,29 @@ files:
155
178
  - spec/configuration_spec.rb
156
179
  - spec/model_lifecycle_spec.rb
157
180
  - spec/model_spec.rb
158
- - spec/rails_template/app/controllers/application_controller.rb
159
- - spec/rails_template/app/controllers/posts_controller.rb
160
- - spec/rails_template/app/models/author.rb
161
- - spec/rails_template/app/models/blog.rb
162
- - spec/rails_template/app/models/location.rb
163
- - spec/rails_template/app/models/photo_post.rb
164
- - spec/rails_template/app/models/post.rb
165
- - spec/rails_template/app/models/post_with_auto.rb
166
- - spec/rails_template/app/models/post_with_default_scope.rb
167
- - spec/rails_template/app/models/post_with_only_some_attributes_triggering_reindex.rb
168
- - spec/rails_template/app/models/rake_task_auto_load_test_model.rb
169
- - spec/rails_template/config/database.yml
170
- - spec/rails_template/config/initializers/rails_5_override.rb
171
- - spec/rails_template/config/routes.rb
172
- - spec/rails_template/config/sunspot.yml
173
- - spec/rails_template/db/schema.rb
181
+ - spec/rails_app/app/controllers/application_controller.rb
182
+ - spec/rails_app/app/controllers/posts_controller.rb
183
+ - spec/rails_app/app/models/author.rb
184
+ - spec/rails_app/app/models/blog.rb
185
+ - spec/rails_app/app/models/location.rb
186
+ - spec/rails_app/app/models/photo_post.rb
187
+ - spec/rails_app/app/models/post.rb
188
+ - spec/rails_app/app/models/post_with_auto.rb
189
+ - spec/rails_app/app/models/post_with_default_scope.rb
190
+ - spec/rails_app/app/models/post_with_only_some_attributes_triggering_reindex.rb
191
+ - spec/rails_app/app/models/rake_task_auto_load_test_model.rb
192
+ - spec/rails_app/config.ru
193
+ - spec/rails_app/config/application.rb
194
+ - spec/rails_app/config/boot.rb
195
+ - spec/rails_app/config/database.yml
196
+ - spec/rails_app/config/environment.rb
197
+ - spec/rails_app/config/environments/test.rb
198
+ - spec/rails_app/config/initializers/rails_5_override.rb
199
+ - spec/rails_app/config/initializers/secret_token.rb
200
+ - spec/rails_app/config/initializers/session_store.rb
201
+ - spec/rails_app/config/routes.rb
202
+ - spec/rails_app/config/sunspot.yml
203
+ - spec/rails_app/db/schema.rb
174
204
  - spec/rake_task_spec.rb
175
205
  - spec/request_lifecycle_spec.rb
176
206
  - spec/schema.rb
@@ -182,7 +212,6 @@ files:
182
212
  - spec/spec_helper.rb
183
213
  - spec/stub_session_proxy_spec.rb
184
214
  - sunspot_rails.gemspec
185
- - tmp/.gitkeep
186
215
  homepage: http://github.com/outoftime/sunspot/tree/master/sunspot_rails
187
216
  licenses:
188
217
  - MIT
@@ -208,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
237
  version: '0'
209
238
  requirements: []
210
239
  rubyforge_project: sunspot
211
- rubygems_version: 2.5.0
240
+ rubygems_version: 2.7.6
212
241
  signing_key:
213
242
  specification_version: 4
214
243
  summary: Rails integration for the Sunspot Solr search library
@@ -216,22 +245,29 @@ test_files:
216
245
  - spec/configuration_spec.rb
217
246
  - spec/model_lifecycle_spec.rb
218
247
  - spec/model_spec.rb
219
- - spec/rails_template/app/controllers/application_controller.rb
220
- - spec/rails_template/app/controllers/posts_controller.rb
221
- - spec/rails_template/app/models/author.rb
222
- - spec/rails_template/app/models/blog.rb
223
- - spec/rails_template/app/models/location.rb
224
- - spec/rails_template/app/models/photo_post.rb
225
- - spec/rails_template/app/models/post.rb
226
- - spec/rails_template/app/models/post_with_auto.rb
227
- - spec/rails_template/app/models/post_with_default_scope.rb
228
- - spec/rails_template/app/models/post_with_only_some_attributes_triggering_reindex.rb
229
- - spec/rails_template/app/models/rake_task_auto_load_test_model.rb
230
- - spec/rails_template/config/database.yml
231
- - spec/rails_template/config/initializers/rails_5_override.rb
232
- - spec/rails_template/config/routes.rb
233
- - spec/rails_template/config/sunspot.yml
234
- - spec/rails_template/db/schema.rb
248
+ - spec/rails_app/app/controllers/application_controller.rb
249
+ - spec/rails_app/app/controllers/posts_controller.rb
250
+ - spec/rails_app/app/models/author.rb
251
+ - spec/rails_app/app/models/blog.rb
252
+ - spec/rails_app/app/models/location.rb
253
+ - spec/rails_app/app/models/photo_post.rb
254
+ - spec/rails_app/app/models/post.rb
255
+ - spec/rails_app/app/models/post_with_auto.rb
256
+ - spec/rails_app/app/models/post_with_default_scope.rb
257
+ - spec/rails_app/app/models/post_with_only_some_attributes_triggering_reindex.rb
258
+ - spec/rails_app/app/models/rake_task_auto_load_test_model.rb
259
+ - spec/rails_app/config.ru
260
+ - spec/rails_app/config/application.rb
261
+ - spec/rails_app/config/boot.rb
262
+ - spec/rails_app/config/database.yml
263
+ - spec/rails_app/config/environment.rb
264
+ - spec/rails_app/config/environments/test.rb
265
+ - spec/rails_app/config/initializers/rails_5_override.rb
266
+ - spec/rails_app/config/initializers/secret_token.rb
267
+ - spec/rails_app/config/initializers/session_store.rb
268
+ - spec/rails_app/config/routes.rb
269
+ - spec/rails_app/config/sunspot.yml
270
+ - spec/rails_app/db/schema.rb
235
271
  - spec/rake_task_spec.rb
236
272
  - spec/request_lifecycle_spec.rb
237
273
  - spec/schema.rb