Sha256: e7a5d6017455482cea0a7dcefc4af80f2df5cee0a690dc946df3fe4c2cc15be6

Contents?: true

Size: 861 Bytes

Versions: 3

Compression:

Stored size: 861 Bytes

Contents

require 'active_record'
require 'generators/purgatory/templates/create_purgatories'
require 'purgatory/purgatory_module'

ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:"

ActiveRecord::Migration.create_table :widgets do |t|
  t.string :name
  t.integer :price
  t.string :original_name 
  t.timestamps
end

ActiveRecord::Migration.create_table :users do |t|
  t.string :name
  t.timestamps
end

ActiveRecord::Migration.create_table :animals do |t|
  t.string :name
  t.string :type
  t.integer :price 
  t.string :original_name 
  t.timestamps
end

CreatePurgatories.new.migrate(:up)

PurgatoryModule.configure do |config|
  config.user_class_name = 'User'
end

RSpec.configure do |config|
  config.around do |example|
    ActiveRecord::Base.transaction do
      example.run
      raise ActiveRecord::Rollback
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
purgatory-2.7.0 spec/support/active_record.rb
purgatory-2.6.0 spec/support/active_record.rb
purgatory-2.5.0 spec/support/active_record.rb