2015-11-30 01:57:45 +00:00
|
|
|
require_relative 'support/unit/load_environment'
|
2010-12-13 22:28:59 +00:00
|
|
|
|
2012-03-24 01:00:36 +00:00
|
|
|
require 'rspec/rails'
|
2014-12-24 21:28:35 +00:00
|
|
|
require 'shoulda-matchers'
|
2010-12-13 22:28:59 +00:00
|
|
|
|
2015-10-07 17:09:59 +00:00
|
|
|
require 'spec_helper'
|
2010-12-13 22:28:59 +00:00
|
|
|
|
2014-10-27 00:52:55 +00:00
|
|
|
Dir[ File.join(File.expand_path('../support/unit/**/*.rb', __FILE__)) ].sort.each do |file|
|
2014-10-27 00:51:42 +00:00
|
|
|
require file
|
|
|
|
end
|
|
|
|
|
2010-12-13 22:28:59 +00:00
|
|
|
RSpec.configure do |config|
|
2014-10-17 18:27:53 +00:00
|
|
|
if config.respond_to?(:infer_spec_type_from_file_location!)
|
|
|
|
config.infer_spec_type_from_file_location!
|
|
|
|
end
|
2014-10-27 00:51:42 +00:00
|
|
|
|
2014-12-24 21:44:38 +00:00
|
|
|
config.before(:all, type: :controller) do
|
|
|
|
self.class.controller(ApplicationController) { }
|
|
|
|
end
|
|
|
|
|
2014-10-27 00:51:42 +00:00
|
|
|
UnitTests::ActiveModelHelpers.configure_example_group(config)
|
|
|
|
UnitTests::ActiveModelVersions.configure_example_group(config)
|
|
|
|
UnitTests::ActiveResourceBuilder.configure_example_group(config)
|
|
|
|
UnitTests::ClassBuilder.configure_example_group(config)
|
|
|
|
UnitTests::ControllerBuilder.configure_example_group(config)
|
|
|
|
UnitTests::I18nFaker.configure_example_group(config)
|
|
|
|
UnitTests::MailerBuilder.configure_example_group(config)
|
|
|
|
UnitTests::ModelBuilder.configure_example_group(config)
|
|
|
|
UnitTests::RailsVersions.configure_example_group(config)
|
2015-01-21 22:46:26 +00:00
|
|
|
UnitTests::ActiveRecordVersions.configure_example_group(config)
|
|
|
|
UnitTests::ActiveModelVersions.configure_example_group(config)
|
2015-02-08 21:38:55 +00:00
|
|
|
UnitTests::DatabaseHelpers.configure_example_group(config)
|
|
|
|
UnitTests::ColumnTypeHelpers.configure_example_group(config)
|
2014-10-27 00:51:42 +00:00
|
|
|
|
|
|
|
config.include UnitTests::Matchers
|
2010-12-13 22:28:59 +00:00
|
|
|
end
|
2014-06-27 22:39:39 +00:00
|
|
|
|
2014-12-24 21:46:10 +00:00
|
|
|
ActiveSupport::Deprecation.behavior = :stderr
|
2014-10-23 00:54:36 +00:00
|
|
|
|
|
|
|
Shoulda::Matchers.configure do |config|
|
|
|
|
config.integrate do |with|
|
|
|
|
with.test_framework :rspec
|
|
|
|
with.library :rails
|
|
|
|
end
|
|
|
|
end
|