Sha256: 78a1c42c9b28761853299305cb4abc7138b91d6d5d6a257880895d608800a2ad

Contents?: true

Size: 774 Bytes

Versions: 3

Compression:

Stored size: 774 Bytes

Contents

require 'active_record'
require 'database_cleaner'
require 'logger'
require 'support/model_macros'

require 'can_be'

ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:"
ActiveRecord::Base.logger = Logger.new(File.join(File.dirname(__FILE__), "../log/debug.log"))
ActiveRecord::Base.send(:include, CanBe::ModelExtensions)

# now that we have the database configured, we can create the models and
# migrate the database
require 'support/models'

RSpec.configure do |config|
  config.include ModelMacros

  config.before(:suite) do
    DatabaseCleaner.strategy = :transaction
    DatabaseCleaner.clean_with(:truncation)
  end

  config.before(:each) do
    DatabaseCleaner.start
  end

  config.after(:each) do
    DatabaseCleaner.clean
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
can_be-0.2.1 spec/spec_helper.rb
can_be-0.2.0 spec/spec_helper.rb
can_be-0.1.0 spec/spec_helper.rb