From 4bc70ae0148b3299137230b6e1ce68ca432a04e7 Mon Sep 17 00:00:00 2001 From: Stephen Crosby Date: Mon, 10 Aug 2015 21:38:39 -0700 Subject: [PATCH] add mongo text search for test env --- .travis.yml | 8 ++++++-- spec/spec_helper.rb | 5 +++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index ebc67ef..51c3f3a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,12 @@ env: - RAILS_ENV=test COVERAGE=true JRUBY_OPTS=--debug sudo: false cache: bundler -services: mongodb -before_script: bundle exec rake errbit:bootstrap +before_script: + - wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.6.10.tgz -O /tmp/mongodb.tgz + - tar -xvf /tmp/mongodb.tgz + - mkdir /tmp/data + - ${PWD}/mongodb-linux-x86_64-2.6.10/bin/mongod --dbpath /tmp/data --bind_ip 127.0.0.1 --auth &> /dev/null & + - bundle exec rake errbit:bootstrap script: bundle exec rspec matrix: allow_failures: diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1510105..c11f9ba 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -31,6 +31,8 @@ require 'errbit_plugin/mock_issue_tracker' # Requires supporting files with custom matchers and macros, etc, # in ./support/ and its subdirectories. Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} +Mongoid::Config.truncate! +Mongoid::Tasks::Database.create_indexes RSpec.configure do |config| config.include Devise::TestHelpers, :type => :controller @@ -38,8 +40,7 @@ RSpec.configure do |config| config.alias_example_to :fit, :focused => true config.before(:each) do - Mongoid.default_client.database.collections.each(&:drop) - Mongoid::Tasks::Database.create_indexes + Mongoid::Config.truncate! end config.include Haml, type: :helper -- libgit2 0.21.2