mirror of
https://github.com/kaminari/kaminari.git
synced 2022-11-09 13:44:37 -05:00
d8c568f05e
You can run generator spec by doing: GENERATOR_SPEC=true rake spec:ative_record_41 We are doing this because we don't want to make API calls in the spec. At the same time, we aldo don't want to use fakeweb or something like that because it causes "you never realize until you go production" situation. We had it before and shipped a bug - we are not sure what is a better solution, but at long as I'm aware of this I'll take care of it.
34 lines
837 B
Ruby
34 lines
837 B
Ruby
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
|
|
begin
|
|
require 'rails'
|
|
rescue LoadError
|
|
end
|
|
|
|
require 'bundler/setup'
|
|
Bundler.require
|
|
|
|
require 'capybara/rspec'
|
|
require 'database_cleaner'
|
|
|
|
# Simulate a gem providing a subclass of ActiveRecord::Base before the Railtie is loaded.
|
|
require 'fake_gem' if defined? ActiveRecord
|
|
|
|
if defined? Rails
|
|
require 'fake_app/rails_app'
|
|
|
|
require 'rspec/rails'
|
|
end
|
|
if defined? Sinatra
|
|
require 'spec_helper_for_sinatra'
|
|
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.mock_with :rr
|
|
config.filter_run_excluding :generator_spec => true if !ENV['GENERATOR_SPEC']
|
|
end
|