Sha256: a513fddc3a792db734fda23563a4d4743a273775cb3c0cf90dfe71a8cf8cfa34

Contents?: true

Size: 1.31 KB

Versions: 6

Compression:

Stored size: 1.31 KB

Contents

Bundler.require(:test)
require 'rspec/autorun'
require 'logger'
require File.expand_path("../../lib/activerecord_pg_stuff", __FILE__)

ActiveRecord::Base.logger = Logger.new(STDOUT)

RSpec.configure do |c|
  c.before(:suite) do
    ActiveRecord::Base.establish_connection
  end

  c.before(:all) do
    conn.execute 'CREATE EXTENSION IF NOT EXISTS tablefunc'
    conn.execute "CREATE TABLE sellers (id integer, name varchar)"
    conn.execute "INSERT INTO sellers VALUES(1, 'foo'), (2, 'bar'), (3, 'baz')"

    conn.execute "CREATE TABLE payments (id integer, amount integer, seller_id integer, created_at timestamp)"
    conn.execute "INSERT INTO payments VALUES(1, 1,  1, '2012-10-12 10:00 UTC')"
    conn.execute "INSERT INTO payments VALUES(2, 3,  1, '2012-11-12 10:00 UTC')"
    conn.execute "INSERT INTO payments VALUES(3, 5,  2, '2012-09-12 10:00 UTC')"
    conn.execute "INSERT INTO payments VALUES(4, 7,  2, '2012-10-12 10:00 UTC')"
    conn.execute "INSERT INTO payments VALUES(5, 11, 2, '2012-11-12 10:00 UTC')"
    conn.execute "INSERT INTO payments VALUES(6, 13, 2, '2012-11-12 10:00 UTC')"
  end

  c.after(:all) do
    conn.execute("DROP TABLE sellers")
    conn.execute("DROP TABLE payments")
  end
end

def conn
  ActiveRecord::Base.connection
end

class Seller < ActiveRecord::Base
end

class Payment < ActiveRecord::Base
end

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
activerecord_pg_stuff-0.2.1 spec/spec_helper.rb
envoy-activerecord_pg_stuff-0.3.0 spec/spec_helper.rb
activerecord_pg_stuff-0.2.0 spec/spec_helper.rb
directory_diff-0.4.5 vendor/gems/activerecord_pg_stuff-0.0.1/spec/spec_helper.rb
directory_diff-0.4.4 vendor/gems/activerecord_pg_stuff-0.0.1/spec/spec_helper.rb
activerecord_pg_stuff-0.0.1 spec/spec_helper.rb