Skip to content

Instantly share code, notes, and snippets.

@jumph4x
Created September 26, 2009 22:14
Show Gist options
  • Save jumph4x/194473 to your computer and use it in GitHub Desktop.
Save jumph4x/194473 to your computer and use it in GitHub Desktop.
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
#database.yml
special_connection:
adapter: postgresql
encoding: utf8
database: special
username: xxxxxxxxxx
password: xxxxxxxxxx
host: 127.0.0.1
# And when I am ready to go with my pretty BDD routine, i get this in my face
denis@ruckus:~/rails/spree$ spork rspec
Using RSpec
Loading Spork.prefork block...
uninitialized constant BaseVehicle (NameError)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment