Sha256: 95cba8b4a6f6dbe4e2301dbb7331476817c6d677a4a1e9223ae9bb3b5df1d13a

Contents?: true

Size: 986 Bytes

Versions: 8

Compression:

Stored size: 986 Bytes

Contents

require "bundler/setup"
require "pg_audit_log"
require "with_model"

connection = nil
begin
  ActiveRecord::Base.establish_connection(:adapter  => 'postgresql',
                                          :database => 'pg_audit_log_test',
                                          :min_messages => 'warning')
  connection = ActiveRecord::Base.connection
  connection.execute("SELECT 1")
rescue PGError => e
  puts "-" * 80
  puts "Unable to connect to database.  Please run:"
  puts
  puts "    createdb pg_audit_log_test"
  puts "-" * 80
  raise e
end


RSpec.configure do |config|
  config.mock_with :rspec
  config.extend WithModel

  config.before(:each) do
    connection.tables.each do |table|
      connection.drop_table_without_auditing(table)
    end
    PgAuditLog::Triggers.uninstall rescue nil
    PgAuditLog::Entry.uninstall
    PgAuditLog::Entry.install
    PgAuditLog::Function.install
  end

  config.after(:each) do
    ActiveRecord::Base.connection.reconnect!
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pg_audit_log-0.4.5 spec/spec_helper.rb
pg_audit_log-0.4.4 spec/spec_helper.rb
pg_audit_log-0.4.0 spec/spec_helper.rb
pg_audit_log-0.3.6 spec/spec_helper.rb
pg_audit_log-0.3.5 spec/spec_helper.rb
pg_audit_log-0.3.4 spec/spec_helper.rb
pg_audit_log-0.3.3 spec/spec_helper.rb
pg_audit_log-0.3.2 spec/spec_helper.rb