Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 4e6b215d65
Fetching contributors…

Cannot retrieve contributors at this time

71 lines (57 sloc) 2.144 kb
#require 'simplecov'
#SimpleCov.start 'rails' do
#add_filter "/cpanel/"
#add_group "cells", "app/cells"
#add_group "uploaders", "app/uploaders"
#end
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
require 'capybara/rspec'
Devise.stretches = 1
Rails.logger.level = 4
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
$original_sunspot_session = Sunspot.session
RSpec.configure do |config|
# == Mock Framework
#
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
#
# config.mock_with :mocha
# config.mock_with :flexmock
# config.mock_with :rr
config.mock_with :rspec
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
# config.fixture_path = "#{::Rails.root}/spec/fixtures"
# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, remove the following line or assign false
# instead of true.
# config.use_transactional_fixtures = false
# If true, the base class of anonymous controllers will be inferred
# automatically. This will be the default behavior in future versions of
# rspec-rails.
config.infer_base_class_for_anonymous_controllers = false
config.render_views
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.include Devise::TestHelpers, :type => :controller
config.after do
Mongoid.database.collections.each do |coll|
coll.remove if coll.name !~ /system/
end
Rails.cache.clear
end
config.include RSpec::Rails::RequestExampleGroup, :type => :request, :example_group => {
:file_path => /spec\/api/
}
end
Jump to Line
Something went wrong with that request. Please try again.