Sha256: 88ed0b664e53e59384237ad854cb7b5cd7455b402bd39eeb01330a54b6899388

Contents?: true

Size: 1.38 KB

Versions: 6

Compression:

Stored size: 1.38 KB

Contents

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'rspec'
require 'supernova'
require "mysql2"
require "logger"
require "fileutils"
require "ruby-debug"
require "geokit"
require "active_record"
PROJECT_ROOT = Pathname.new(File.expand_path("..", File.dirname(__FILE__)))

if defined?(Debugger) && Debugger.respond_to?(:settings)
  Debugger.settings[:autolist] = 1
  Debugger.settings[:autoeval] = true
end

# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}

RSpec.configure do |config|
  config.before(:each) do
    ActiveRecord::Base.connection.execute("TRUNCATE offers")
  end
end


ActiveRecord::Base.establish_connection(
  :adapter => "mysql2",
  :host => "localhost", 
  :database => "supernova_test", 
  :username => "root",
  :encoding => "utf8"
)


FileUtils.mkdir_p(PROJECT_ROOT.join("log"))

ActiveRecord::Base.connection.execute("DROP TABLE IF EXISTS offers")
ActiveRecord::Base.connection.execute("CREATE TABLE offers (id SERIAL, text TEXT, user_id INTEGER, enabled BOOLEAN, popularity INTEGER, lat FLOAT, lng FLOAT)")

class Offer < ActiveRecord::Base
  include Supernova::Solr
  named_search_scope :for_user_ids do |*ids|
    with(:user_id => ids.flatten)
  end
end

class Host
  attr_accessor :id
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
supernova-0.6.2 spec/spec_helper.rb
supernova-0.6.1 spec/spec_helper.rb
supernova-0.6.0 spec/spec_helper.rb
supernova-0.4.18 spec/spec_helper.rb
supernova-0.4.17 spec/spec_helper.rb
supernova-0.4.16 spec/spec_helper.rb