Sha256: 28f7302ff7b137143503826b83d7d48550a77c6f6cefc958ecff6adc484fec60

Contents?: true

Size: 970 Bytes

Versions: 1

Compression:

Stored size: 970 Bytes

Contents

# frozen_string_literal: true

$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
require 'acts_as_contactable'
require 'sqlite3'
require 'simplecov'
require 'factory_bot'

Dir['./spec/shared_example/**/*.rb'].sort.each { |f| require f }
Dir['./spec/support/**/*.rb'].sort.each { |f| require f }

SimpleCov.start

ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')

ActiveRecord::Schema.define(version: 1) do
  create_table :addresses do |t|
    t.references :addressable, polymorphic: true

    t.string :name
    t.string :street
    t.string :street2
    t.string :city
    t.string :state
    t.string :zip
    t.boolean :primary

    t.timestamps
  end

  add_index :addresses, [:addressable_id, :addressable_type]

  create_table :addressables do |t|
    t.string :name
  end
end

class Contactable < ActiveRecord::Base
  acts_as_contactable
  validates_presence_of :name
end

class NotContactable < ActiveRecord::Base
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acts-as-contactable-0.2.0 spec/spec_helper.rb