Got Mongoid and FactoryGirl to stop preloading models (#157)

This commit is contained in:
did 2011-08-16 20:58:23 +02:00
parent c3ba38216d
commit e0b9367f10
2 changed files with 25 additions and 19 deletions

View File

@ -1,6 +1,6 @@
GIT
remote: git://github.com/floehopper/mocha.git
revision: f417066f7f1b7d66cf5c72f28380675bde0cc424
revision: afa87804ca2124ff5e77f007a84a26ee0667eec8
specs:
mocha (0.9.12)
metaclass (~> 0.0.1)
@ -14,7 +14,7 @@ GEM
Platform (0.4.0)
RedCloth (4.2.7)
SystemTimer (1.2.3)
ZenTest (4.6.0)
ZenTest (4.6.1)
abstract (1.0.0)
actionmailer (3.0.9)
actionpack (= 3.0.9)
@ -60,19 +60,19 @@ GEM
bushido_stub (0.0.3)
activesupport (>= 3.0.7)
cancan (1.6.5)
capybara (1.0.0)
capybara (1.0.1)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
selenium-webdriver (~> 0.2.0)
selenium-webdriver (~> 2.0)
xpath (~> 0.1.4)
carrierwave (0.5.6)
activesupport (~> 3.0)
cells (3.6.4)
cells (3.6.5)
actionpack (~> 3.0)
railties (~> 3.0)
childprocess (0.2.0)
childprocess (0.2.1)
ffi (~> 1.0.6)
columnize (0.3.4)
configuration (1.3.1)
@ -107,12 +107,12 @@ GEM
devise (>= 1.0.6)
rubycas-client (>= 2.2.1)
diff-lcs (1.1.2)
dragonfly (0.9.4)
dragonfly (0.9.5)
rack
erubis (2.6.6)
abstract (>= 1.0.0)
excon (0.6.5)
factory_girl (2.0.1)
factory_girl (2.0.4)
factory_girl_rails (1.1.0)
factory_girl (~> 2.0.0)
railties (>= 3.0.0)
@ -131,15 +131,15 @@ GEM
actionpack (>= 2.3.7)
activesupport (>= 2.3.7)
i18n (~> 0.4)
gherkin (2.4.5)
gherkin (2.4.6)
json (>= 1.4.6)
growl-glue (1.0.7)
haml (3.1.2)
has_scope (0.5.0)
has_scope (0.5.1)
heroku (1.19.1)
activesupport (>= 2.1.0)
launchy (~> 0.3.2)
rest-client (< 1.7.0, >= 1.4.0)
rest-client (>= 1.4.0, < 1.7.0)
highline (1.6.2)
httparty (0.7.8)
crack (= 0.1.8)
@ -187,7 +187,7 @@ GEM
pickle (0.4.8)
cucumber (>= 0.8)
rake
polyglot (0.3.1)
polyglot (0.3.2)
proxies (0.2.1)
rack (1.2.3)
rack-cache (1.0.2)
@ -212,7 +212,7 @@ GEM
thor (~> 0.14.4)
raindrops (0.7.0)
rake (0.9.2)
rdoc (3.8)
rdoc (3.9.2)
responders (0.6.4)
rest-client (1.6.3)
mime-types (>= 1.16)
@ -256,22 +256,23 @@ GEM
s3 (0.3.8)
proxies (~> 0.2.0)
sass (3.1.2)
selenium-webdriver (0.2.2)
childprocess (>= 0.1.9)
selenium-webdriver (2.4.0)
childprocess (>= 0.2.1)
ffi (>= 1.0.7)
json_pure
rubyzip
spork (0.9.0.rc9)
term-ansicolor (1.0.6)
thor (0.14.6)
treetop (1.4.9)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.29)
unicorn (4.0.1)
kgio (~> 2.4)
rack
raindrops (~> 0.6)
warden (1.0.4)
warden (1.0.5)
rack (>= 1.0)
will_paginate (3.0.0)
xpath (0.1.4)

View File

@ -35,12 +35,17 @@ Spork.prefork do
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
# Avoid preloading models
require 'rails/mongoid'
Spork.trap_class_method(Rails::Mongoid, :load_models)
require File.expand_path('../../config/environment', __FILE__)
require 'rspec/rails'
require 'factory_girl'
FactoryGirl.find_definitions
require 'factory_girl'
Spork.trap_class_method(FactoryGirl, :find_definitions)
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.