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
@@ -1,97 +0,0 @@
1
- require 'fileutils'
2
-
3
- namespace :spec do
4
- def rails_app_path(version)
5
- File.join(File.dirname(__FILE__), "..", "tmp", "rails_#{version.gsub(".", "_")}_app")
6
- end
7
-
8
- def gemfile_path(version)
9
- File.join(File.dirname(__FILE__), "..", "gemfiles", "rails-#{version}")
10
- end
11
-
12
- def vendor_path(version)
13
- File.expand_path("vendor/bundle", rails_app_path(version))
14
- end
15
-
16
- def rails_template_path
17
- File.join(File.dirname(__FILE__), "..", "spec", "rails_template")
18
- end
19
-
20
- def version
21
- ENV['VERSION']
22
- end
23
-
24
- task :run_with_rails => [:set_gemfile, :generate_rails_app, :initialize_database, :setup_rails_app, :run]
25
-
26
- task :set_gemfile do
27
- ENV['BUNDLE_PATH'] = vendor_path(version)
28
- ENV['BUNDLE_GEMFILE'] = gemfile_path(version)
29
-
30
- unless File.exist?(ENV['BUNDLE_PATH'])
31
- puts "Installing gems for Rails #{version} (this will only be done once)..."
32
- sh("bundle install #{ENV['BUNDLE_ARGS']}") || exit(1)
33
- end
34
- end
35
-
36
- task :generate_rails_app do
37
- app_path = rails_app_path(version)
38
-
39
- unless File.exist?(File.expand_path("config/environment.rb", app_path))
40
- puts "Generating Rails #{version} application..."
41
- sh("bundle exec rails _#{version}_ new \"#{app_path}\" --force --skip-git --skip-javascript --skip-gemfile --skip-sprockets") || exit(1)
42
- end
43
- end
44
-
45
- task :initialize_database do
46
- if ENV['DB'] == 'postgres'
47
- sh "bundle exec rake db:test:prepare"
48
- end
49
- end
50
-
51
- task :setup_rails_app do
52
- FileUtils.cp_r File.join(rails_template_path, "."), rails_app_path(version)
53
- end
54
-
55
- task :run do
56
- ENV['BUNDLE_GEMFILE'] = gemfile_path(version)
57
- ENV['RAILS_ROOT'] = rails_app_path(version)
58
-
59
- sh "bundle exec rspec #{ENV['SPEC'] || 'spec/*_spec.rb'} --color"
60
- end
61
- end
62
-
63
- def rails_all_versions
64
- versions = []
65
- Dir.glob(File.join(File.dirname(__FILE__), "..", "gemfiles", "rails-*")).each do |gemfile|
66
- if !gemfile.end_with?(".lock") && gemfile =~ /rails-([0-9.]+)/
67
- versions << $1
68
- end
69
- end
70
-
71
- versions
72
- end
73
-
74
- def reenable_spec_tasks
75
- Rake::Task.tasks.each do |task|
76
- if task.name =~ /spec:/
77
- task.reenable
78
- end
79
- end
80
- end
81
-
82
- desc 'Run spec suite in all Rails versions'
83
- task :spec do
84
- versions = if ENV['RAILS']
85
- ENV['RAILS'].split(",")
86
- else
87
- rails_all_versions
88
- end
89
-
90
- versions.each do |version|
91
- puts "Running specs against Rails #{version}..."
92
-
93
- ENV['VERSION'] = version
94
- reenable_spec_tasks
95
- Rake::Task['spec:run_with_rails'].invoke
96
- end
97
- end
@@ -1,21 +0,0 @@
1
- source 'http://rubygems.org'
2
-
3
- gem 'rails', '~> 3.0.0'
4
-
5
- gem 'sunspot', :path => File.expand_path('../../../sunspot', __FILE__)
6
- gem 'sunspot_solr', :path => File.expand_path('../../../sunspot_solr', __FILE__)
7
- gem 'sunspot_rails', :path => File.expand_path('../..', __FILE__)
8
-
9
- group :test do
10
- gem 'rspec-rails', '~> 2.14.0'
11
- gem 'progress_bar', '~> 1.0.5', require: false
12
- gem 'test-unit', '~> 3.2.0' if RUBY_VERSION >= '2.2.0'
13
- end
14
-
15
- group :postgres do
16
- gem 'pg', '~> 0.18.4'
17
- end
18
-
19
- group :sqlite do
20
- gem 'sqlite3', '~> 1.3.7'
21
- end
@@ -1,21 +0,0 @@
1
- source 'http://rubygems.org'
2
-
3
- gem 'rails', '~> 3.1.0'
4
-
5
- gem 'sunspot', :path => File.expand_path('../../../sunspot', __FILE__)
6
- gem 'sunspot_solr', :path => File.expand_path('../../../sunspot_solr', __FILE__)
7
- gem 'sunspot_rails', :path => File.expand_path('../..', __FILE__)
8
-
9
- group :test do
10
- gem 'rspec-rails', '~> 2.14.0'
11
- gem 'progress_bar', '~> 1.0.5', require: false
12
- gem 'test-unit', '~> 3.2.0' if RUBY_VERSION >= '2.2.0'
13
- end
14
-
15
- group :postgres do
16
- gem 'pg', '~> 0.18.4'
17
- end
18
-
19
- group :sqlite do
20
- gem 'sqlite3', '~> 1.3.7'
21
- end
@@ -1,21 +0,0 @@
1
- source 'http://rubygems.org'
2
-
3
- gem 'rails', '~> 3.2.0'
4
-
5
- gem 'sunspot', :path => File.expand_path('../../../sunspot', __FILE__)
6
- gem 'sunspot_solr', :path => File.expand_path('../../../sunspot_solr', __FILE__)
7
- gem 'sunspot_rails', :path => File.expand_path('../..', __FILE__)
8
-
9
- group :test do
10
- gem 'rspec-rails', '~> 2.14.0'
11
- gem 'progress_bar', '~> 1.0.5', require: false
12
- gem 'test-unit', '~> 3.2.0' if RUBY_VERSION >= '2.2.0'
13
- end
14
-
15
- group :postgres do
16
- gem 'pg', '~> 0.18.4'
17
- end
18
-
19
- group :sqlite do
20
- gem 'sqlite3', '~> 1.3.7'
21
- end
@@ -1,25 +0,0 @@
1
- source 'http://rubygems.org'
2
-
3
- gem 'rails', '~> 4.0.0'
4
- if RUBY_VERSION < '2.0'
5
- gem 'mime-types', '~> 2.99.0'
6
- end
7
-
8
- gem 'sunspot', :path => File.expand_path('../../../sunspot', __FILE__)
9
- gem 'sunspot_solr', :path => File.expand_path('../../../sunspot_solr', __FILE__)
10
- gem 'sunspot_rails', :path => File.expand_path('../..', __FILE__)
11
-
12
- group :test do
13
- gem 'protected_attributes' # Rails 4 support for attr_accessor so specs still work
14
- gem 'rspec-rails', '~> 2.14.0'
15
- gem 'progress_bar', '~> 1.0.5', require: false
16
- gem 'test-unit', '~> 3.2.0' if RUBY_VERSION >= '2.2.0'
17
- end
18
-
19
- group :postgres do
20
- gem 'pg', '~> 0.18.4'
21
- end
22
-
23
- group :sqlite do
24
- gem 'sqlite3', '~> 1.3.7'
25
- end
@@ -1,24 +0,0 @@
1
- source 'http://rubygems.org'
2
-
3
- gem 'rails', '~> 4.1.0'
4
- if RUBY_VERSION < '2.0'
5
- gem 'mime-types', '~> 2.99.0'
6
- end
7
-
8
- gem 'sunspot', :path => File.expand_path('../../../sunspot', __FILE__)
9
- gem 'sunspot_solr', :path => File.expand_path('../../../sunspot_solr', __FILE__)
10
- gem 'sunspot_rails', :path => File.expand_path('../..', __FILE__)
11
-
12
- group :test do
13
- gem 'protected_attributes' # Rails 4 support for attr_accessor so specs still work
14
- gem 'rspec-rails', '~> 2.14.0'
15
- gem 'progress_bar', '~> 1.0.5', require: false
16
- end
17
-
18
- group :postgres do
19
- gem 'pg', '~> 0.18.4'
20
- end
21
-
22
- group :sqlite do
23
- gem 'sqlite3', '~> 1.3.7'
24
- end
@@ -1,24 +0,0 @@
1
- source 'http://rubygems.org'
2
-
3
- gem 'rails', '~> 4.2.0'
4
- if RUBY_VERSION < '2.0'
5
- gem 'mime-types', '~> 2.99.0'
6
- end
7
-
8
- gem 'sunspot', :path => File.expand_path('../../../sunspot', __FILE__)
9
- gem 'sunspot_solr', :path => File.expand_path('../../../sunspot_solr', __FILE__)
10
- gem 'sunspot_rails', :path => File.expand_path('../..', __FILE__)
11
-
12
- group :test do
13
- gem 'protected_attributes' # Rails 4 support for attr_accessor so specs still work
14
- gem 'rspec-rails', '~> 2.14.0'
15
- gem 'progress_bar', '~> 1.0.5', require: false
16
- end
17
-
18
- group :postgres do
19
- gem 'pg', '~> 0.18.4'
20
- end
21
-
22
- group :sqlite do
23
- gem 'sqlite3', '~> 1.3.7'
24
- end
@@ -1,20 +0,0 @@
1
- source 'http://rubygems.org'
2
-
3
- gem 'rails', '~> 5.0'
4
- gem 'sunspot', :path => File.expand_path('../../../sunspot', __FILE__)
5
- gem 'sunspot_solr', :path => File.expand_path('../../../sunspot_solr', __FILE__)
6
- gem 'sunspot_rails', :path => File.expand_path('../..', __FILE__)
7
-
8
- group :test do
9
- gem 'protected_attributes_continued'
10
- gem 'rspec-rails', '~> 2.14.0'
11
- gem 'progress_bar', '~> 1.0.5', require: false
12
- end
13
-
14
- group :postgres do
15
- gem 'pg', '~> 0.18.4'
16
- end
17
-
18
- group :sqlite do
19
- gem 'sqlite3', '~> 1.3.7'
20
- end
@@ -1,10 +0,0 @@
1
- # Filters added to this controller apply to all controllers in the application.
2
- # Likewise, all the methods added will be available for all controllers.
3
-
4
- class ApplicationController < ActionController::Base
5
- helper :all # include all helpers, all the time
6
- protect_from_forgery # See ActionController::RequestForgeryProtection for details
7
-
8
- # Scrub sensitive parameters from your log
9
- # filter_parameter_logging :password
10
- end
@@ -1,6 +0,0 @@
1
- class PostsController < ApplicationController
2
- def create
3
- PostWithAuto.create(params[:post])
4
- render :nothing => true
5
- end
6
- end
@@ -1,11 +0,0 @@
1
- <% if ENV['DB'] == 'postgres' %>
2
- test:
3
- adapter: postgresql
4
- database: sunspot_test
5
- <% elsif ENV['DB'] == 'sqlite' %>
6
- test:
7
- adapter: sqlite3
8
- database: db/test.sqlite3
9
- pool: 5
10
- timeout: 5000
11
- <% end %>
@@ -1,27 +0,0 @@
1
- ActiveRecord::Schema.define(:version => 0) do
2
- create_table :posts, :force => true do |t|
3
- t.string :title
4
- t.string :type
5
- t.integer :location_id
6
- t.text :body
7
- t.references :blog
8
- t.timestamps
9
- end
10
-
11
- create_table :locations, :force => true do |t|
12
- t.float :lat
13
- t.float :lng
14
- end
15
-
16
- create_table :blogs, :force => true do |t|
17
- t.string :name
18
- t.string :subdomain
19
- t.timestamps
20
- end
21
-
22
- create_table :writers, :force => true, :primary_key => :writer_id do |t|
23
- t.string :name
24
- t.timestamps
25
- end
26
-
27
- end