Sha256: 14da26ee789aae0ea779008de38dcdb28d6cdd6d7906af0a9d66b5c1c7df2b43

Contents?: true

Size: 980 Bytes

Versions: 9

Compression:

Stored size: 980 Bytes

Contents

require "active_support"
require "active_record"
require "has_normalized_attributes"
require "database_cleaner"
require "yaml"

ENV['debug'] = 'test' unless ENV['debug']

# Establish DB Connection
config = YAML::load(IO.read(File.join(File.dirname(__FILE__), 'db', 'database.yml')))
ActiveRecord::Base.configurations = {'test' => config[ENV['DB'] || 'sqlite3']}
ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations['test'])

# Load Test Schema into the Database
load(File.dirname(__FILE__) + "/db/schema.rb")

# Load in our code
$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib"

require 'shoulda-matchers'
require 'has_validated_attributes'
require 'has_validated_attributes/rspec'

RSpec.configure do |config|

  config.before(:suite) do
    DatabaseCleaner.strategy = :transaction
    DatabaseCleaner.clean_with(:truncation)
  end

  config.before(:each) do
    DatabaseCleaner.start
  end

  config.after(:each) do
    DatabaseCleaner.clean
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
has_validated_attributes-1.0.3 spec/spec_helper.rb
has_validated_attributes-1.0.2 spec/spec_helper.rb
has_validated_attributes-1.0.1 spec/spec_helper.rb
has_validated_attributes-1.0.0 spec/spec_helper.rb
has_validated_attributes-0.0.14 spec/spec_helper.rb
has_validated_attributes-0.0.13 spec/spec_helper.rb
has_validated_attributes-0.0.12 spec/spec_helper.rb
has_validated_attributes-0.0.11 spec/spec_helper.rb
has_validated_attributes-0.0.10 spec/spec_helper.rb