Sha256: 1ad26ca89e9a51ada32bfb01e4da524832219fa41cb6c73c421c263d5a4575a8

Contents?: true

Size: 1.21 KB

Versions: 6

Compression:

Stored size: 1.21 KB

Contents

ENV["RAILS_ENV"] = "development"
ENV["MONGOID_ENV"] = "development"

require "rubygems"
require "serialize_with"
require "active_record"
require "mongoid"
require "mongoid/serialize_with"

Mongoid.load!("#{Dir.pwd}/spec/mongoid.yml")

ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
ActiveRecord::Migration.verbose = false
ActiveRecord::Base.include_root_in_json = false

migration = Class.new(ActiveRecord::Migration) do
  def change
    create_table :customers, :force => true do |t|
      t.string :first_name
      t.string :last_name
      t.string :address
    end
    create_table :products, :force => true do |t|
      t.string :name
      t.string :sku
      t.string :manufacturer
      t.decimal :price
    end
    create_table :orders, :force => true do |t|
      t.integer :customer_id
      t.decimal :order_total
    end
    create_table :order_items, :force => true do |t|
      t.integer :order_id
      t.string :product_sku
      t.integer :quantity
      t.integer :product_id
      t.decimal :price
    end
  end
end

migration.new.migrate(:up)

ActiveSupport.on_load(:active_record) do
  self.extend SerializeWith
end

RSpec.configure do |config|
  config.mock_with :rspec
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
serialize_with-0.1.7 spec/spec_helper.rb
serialize_with-0.1.6 spec/spec_helper.rb
serialize_with-0.1.5 spec/spec_helper.rb
serialize_with-0.1.4 spec/spec_helper.rb
serialize_with-0.1.3 spec/spec_helper.rb
serialize_with-0.1.2 spec/spec_helper.rb