spec/spec_helper.rb in russian_phone-0.7.0 vs spec/spec_helper.rb in russian_phone-0.8.0
- old
+ new
@@ -2,13 +2,15 @@
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'rspec'
require 'simplecov'
+require 'sqlite3'
require 'mongoid'
require 'active_record'
require 'database_cleaner'
+require 'database_cleaner-mongoid'
require 'pry'
SimpleCov.start
require 'russian_phone'
Mongoid.configure do |config|
@@ -29,23 +31,26 @@
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
-DatabaseCleaner.orm = "mongoid"
+# DatabaseCleaner.orm = "mongoid"
RSpec.configure do |config|
config.before(:all) do
- DatabaseCleaner.strategy = :truncation
+ DatabaseCleaner.strategy = :deletion
end
config.before(:each) do
+ DatabaseCleaner[:mongoid].start
DatabaseCleaner.start
end
config.after(:each) do
+ DatabaseCleaner[:mongoid].clean
DatabaseCleaner.clean
ArUser.destroy_all
end
+ config.expect_with(:rspec) { |c| c.syntax = :should }
config.mock_with :rspec
end