spec/spec_helper.rb in knitkit-2.0.11 vs spec/spec_helper.rb in knitkit-2.1.0

- old
+ new

@@ -1,7 +1,8 @@ require 'spork' require 'rake' +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. @@ -26,36 +27,42 @@ # in spec/support/ and its subdirectories. Dir[File.join(ENGINE_RAILS_ROOT, "spec/support/**/*.rb")].each {|f| require f } require 'rspec/rails' require 'erp_dev_svcs' - + RSpec.configure do |config| config.use_transactional_fixtures = true + config.include FactoryGirl::Syntax::Methods config.include Sorcery::TestHelpers::Rails config.include ErpDevSvcs config.include ErpDevSvcs::ControllerSupport, :type => :controller end end Spork.each_run do #We have to execute the migrations from dummy app directory Dir.chdir DUMMY_APP_ROOT - `rake db:drop` + `rake db:drop RAILS_ENV=spec` Dir.chdir ENGINE_RAILS_ROOT - #We have to execute the migrations from dummy app directory + #We have to execute the migratiapp:compass_ae:install:data_migrationsons from dummy app directory Dir.chdir DUMMY_APP_ROOT - `rake db:migrate` - `rake db:migrate_data` + + + `rake compass_ae:install:migrations RAILS_ENV=spec` + `rake compass_ae:install:data_migrations RAILS_ENV=spec` + `rake db:migrate RAILS_ENV=spec` + `rake db:migrate_data RAILS_ENV=spec` Dir.chdir ENGINE_RAILS_ROOT ErpDevSvcs::FactorySupport.load_engine_factories require 'simplecov' SimpleCov.start 'rails' do add_filter "spec/" end - #Need to explictly load the files in lib/ until we figure out how to + #Need to explictly load the files in lib/ until we figure out how to #get rails to autoload them for spec like it used to... Dir[File.join(ENGINE_RAILS_ROOT, "lib/**/*.rb")].each {|f| load f} + Dir[File.join(ENGINE_RAILS_ROOT, "app/models/extensions/**/*.rb")].each {|f| load f} end