Skip to content

Instantly share code, notes, and snippets.

View jumph4x's full-sized avatar
🌴
Talk to me about Ecommerce!

Denis Ivanov jumph4x

🌴
Talk to me about Ecommerce!
View GitHub Profile
require 'rubygems'
require 'spork'
require 'factory_girl'
Spork.prefork do
# Loading more in this block will cause your tests to run faster. However,
# if you change any configuration or code from libraries loaded here, you'll
# need to restart spork for it take effect.
unless defined? SPREE_ROOT
@jumph4x
jumph4x / gist:194473
Created September 26, 2009 22:14
Can factory_girl do this? Is it my RSpec loading order?
# factories.rb
Factory.define :app do |i|
i.association :sku, :factory => :sku
i.base_vehicle_id BaseVehicle.last.id
end
# base_vehicle.rb
class BaseVehicle < ActiveRecord::Base
self.establish_connection :special_connection
end