Skip to content

Commit

Permalink
add sunspot.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeta committed Jul 9, 2018
1 parent 81e78b6 commit 37b5de6
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 15 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ before_script:
- mysql -e 'create database enju_test DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;'
- psql -c 'create database enju_test;' -U postgres
- bundle exec rake db:migrate
- bundle exec rake app:sunspot:solr:start
services:
- redis-server
env:
Expand Down
3 changes: 1 addition & 2 deletions enju_inter_library_loan.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ Gem::Specification.new do |s|
s.add_development_dependency "pg"
s.add_development_dependency "rspec-rails", "~> 3.7"
s.add_development_dependency "factory_bot_rails"
s.add_development_dependency "sunspot_solr", "2.2.0"
s.add_development_dependency "sunspot-rails-tester"
s.add_development_dependency "sunspot_solr", "~> 2.3"
s.add_development_dependency "simplecov"
s.add_development_dependency "coveralls"
end
23 changes: 23 additions & 0 deletions spec/dummy/config/sunspot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
production:
solr:
hostname: localhost
port: 8983
log_level: WARNING
path: /solr/production
# read_timeout: 2
# open_timeout: 0.5

development:
solr:
hostname: localhost
port: 8982
log_level: INFO
path: /solr/development

test:
solr:
hostname: localhost
port: 8981
log_level: WARNING
path: /solr/test

13 changes: 0 additions & 13 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
require File.expand_path("../dummy/config/environment", __FILE__)
require 'rspec/rails'
require 'factory_bot'
require 'sunspot-rails-tester'

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Expand All @@ -34,18 +33,6 @@

config.extend ControllerMacros, type: :controller

$original_sunspot_session = Sunspot.session

config.before do
Sunspot.session = Sunspot::Rails::StubSessionProxy.new($original_sunspot_session)
end

config.before :each, solr: true do
Sunspot::Rails::Tester.start_original_sunspot_session
Sunspot.session = $original_sunspot_session
#Sunspot.remove_all!
end

config.infer_spec_type_from_file_location!
end

Expand Down

0 comments on commit 37b5de6

Please sign in to comment.