Sha256: 99c1be36614702a4eee3a48e2226fa8ccaa9b58dc255cda4844d4c4f4e89e59d

Contents?: true

Size: 1.13 KB

Versions: 2

Compression:

Stored size: 1.13 KB

Contents

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'rspec'
require 'active_record/railtie'
ActiveRecord::Base.logger = Logger.new(STDERR)
ActiveRecord::Base.logger.level = 3

require 'acts-as-taggable-array-on'

#Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}

ActiveRecord::Migration.verbose = false

class User < ActiveRecord::Base; end

RSpec.configure do |config|
  config.before(:all) do
    ActiveRecord::Base.establish_connection(
      adapter: "postgresql", 
      encoding: 'unicode',
      database: "acts-as-taggable-array-on_test",
      username: "acts-as-taggable-array-on"
    )
    create_database
  end

  config.after(:all) do
    drop_database
  end

  config.after(:each) do
    User.delete_all
  end
end

def create_database
  ActiveRecord::Schema.define(:version => 1) do
    create_table :users do |t|
      t.string :name
      t.text :colors, array: true, defualt: '{}'
      t.timestamps
    end
  end
end

def drop_database
  ActiveRecord::Base.connection.tables.each do |table|
    ActiveRecord::Base.connection.drop_table(table)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
acts-as-taggable-array-on-0.2.1 spec/spec_helper.rb
acts-as-taggable-array-on-0.2.0 spec/spec_helper.rb