Sha256: 596d6ef5cbff2131e1f95bf892ec65c89248fe9c5cd9c1e34f0057a7f210bbd3

Contents?: true

Size: 1012 Bytes

Versions: 2

Compression:

Stored size: 1012 Bytes

Contents

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'rubygems'
require 'active_record'
require 'rspec'
require 'sid'
require 'spec/fixtures/page'
require 'spec/fixtures/category'

# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}

#Allow to connect to SQLite
ActiveRecord::Base.establish_connection(
  :adapter => "sqlite3",
  :database => ":memory:"
)

RSpec.configure do |config|

end

def reset_database
  %W(pages categories).each do |table_name|
    ActiveRecord::Base.connection.execute("DROP TABLE IF EXISTS '#{table_name}'")
  end
  ActiveRecord::Base.connection.create_table(:pages) do |t|
    t.string :name
    t.integer :account_id
    t.integer :sid
  end
  ActiveRecord::Base.connection.create_table(:categories) do |t|
    t.string :name
    t.integer :account_id
    t.integer :alternative_sid
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sid-0.0.4 spec/spec_helper.rb
sid-0.0.3 spec/spec_helper.rb