Commit 4bc70ae0148b3299137230b6e1ce68ca432a04e7

Authored by Stephen Crosby
1 parent 029244c5
Exists in master and in 1 other branch production

add mongo text search for test env

Showing 2 changed files with 9 additions and 4 deletions   Show diff stats
.travis.yml
... ... @@ -9,8 +9,12 @@ env:
9 9 - RAILS_ENV=test COVERAGE=true JRUBY_OPTS=--debug
10 10 sudo: false
11 11 cache: bundler
12   -services: mongodb
13   -before_script: bundle exec rake errbit:bootstrap
  12 +before_script:
  13 + - wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.6.10.tgz -O /tmp/mongodb.tgz
  14 + - tar -xvf /tmp/mongodb.tgz
  15 + - mkdir /tmp/data
  16 + - ${PWD}/mongodb-linux-x86_64-2.6.10/bin/mongod --dbpath /tmp/data --bind_ip 127.0.0.1 --auth &> /dev/null &
  17 + - bundle exec rake errbit:bootstrap
14 18 script: bundle exec rspec
15 19 matrix:
16 20 allow_failures:
... ...
spec/spec_helper.rb
... ... @@ -31,6 +31,8 @@ require 'errbit_plugin/mock_issue_tracker'
31 31 # Requires supporting files with custom matchers and macros, etc,
32 32 # in ./support/ and its subdirectories.
33 33 Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
  34 +Mongoid::Config.truncate!
  35 +Mongoid::Tasks::Database.create_indexes
34 36  
35 37 RSpec.configure do |config|
36 38 config.include Devise::TestHelpers, :type => :controller
... ... @@ -38,8 +40,7 @@ RSpec.configure do |config|
38 40 config.alias_example_to :fit, :focused => true
39 41  
40 42 config.before(:each) do
41   - Mongoid.default_client.database.collections.each(&:drop)
42   - Mongoid::Tasks::Database.create_indexes
  43 + Mongoid::Config.truncate!
43 44 end
44 45  
45 46 config.include Haml, type: :helper
... ...