Sha256: ce0bd189354b57e8bcb876a05f6836fc156b2d4cc2c7fdb468aacc7fae6c2997

Contents?: true

Size: 1.76 KB

Versions: 9

Compression:

Stored size: 1.76 KB

Contents

require 'rubygems'
require 'test/unit'
require 'mocks/test/death_master_file_loader'

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'ssn_validator'

ActiveRecord::Base.establish_connection :adapter => 'sqlite3', :database => ':memory:'


def setup_high_group_codes_table
	ActiveRecord::Base.connection.tables.each { |table| ActiveRecord::Base.connection.drop_table(table) }
  create_ssn_high_group_codes_table
end

def setup_death_master_file_table
	ActiveRecord::Base.connection.tables.each { |table| ActiveRecord::Base.connection.drop_table(table) }
  create_death_master_file_table
end

private

def create_ssn_high_group_codes_table
  silence_stream(STDOUT) do
    ActiveRecord::Schema.define(:version => 1) do
      create_table :ssn_high_group_codes do |t|
        t.date      :as_of
        t.string    :area
        t.string    :group
        t.timestamps
      end

      add_index :ssn_high_group_codes, [:area]
      add_index :ssn_high_group_codes, [:area, :as_of]
    end
  end
end

def create_death_master_file_table
  silence_stream(STDOUT) do
    ActiveRecord::Schema.define(:version => 1) do
      create_table :death_master_files do |t|
        t.string :social_security_number
        t.string  :last_name
        t.string  :name_suffix
        t.string :first_name
        t.string :middle_name
        t.string :verify_proof_code
        t.date  :date_of_death
        t.date  :date_of_birth
        t.string  :state_of_residence
        t.string :last_known_zip_residence
        t.string :last_known_zip_payment
        t.timestamps
        t.date :as_of
      end
      add_index :death_master_files, :social_security_number, :unique => true
      add_index :death_master_files, :as_of
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
kevintyll-ssn_validator-1.0.2 test/test_helper.rb
kevintyll-ssn_validator-1.0.3 test/test_helper.rb
ssn_validator-1.0.11 test/test_helper.rb
ssn_validator-1.0.10 test/test_helper.rb
ssn_validator-1.0.9 test/test_helper.rb
ssn_validator-1.0.8 test/test_helper.rb
ssn_validator-1.0.7 test/test_helper.rb
ssn_validator-1.0.6 test/test_helper.rb
ssn_validator-1.0.4 test/test_helper.rb