spec/spec_helper.rb in active_metadata-0.1.9 vs spec/spec_helper.rb in active_metadata-0.2.0

- old
+ new

@@ -2,11 +2,10 @@ require 'rubygems' require "rails/all" require "logger" require 'rspec/core' require "sqlite3" -require "mongoid" require "rack/test/uploaded_file" $: << File.expand_path(File.dirname(__FILE__) + "/../app") gemfile = File.expand_path('../Gemfile', __FILE__) @@ -24,18 +23,10 @@ ENV["ACTIVE_METADATA_ENV"] ||= 'test' ActiveRecord::Base.establish_connection YAML.load_file("config/database.yml")[ENV["RAILS_ENV"]] ActiveRecord::Base.logger = Logger.new "log/test.log" Rails.logger = ActiveRecord::Base.logger - -#load the config -conf = YAML.load_file('config/active_metadata.yml')[Rails.env] -is_mongo = conf['persists_with'] == 'mongoid' - -if is_mongo - Mongoid.load!("config/mongoid.yml") -end # loading ruby files require "#{File.dirname(__FILE__)}/../lib/engine.rb" Dir["spec/support/*.rb"].each {|f| require "support/#{(File.basename(f, File.extname(f)) )}"} @@ -58,27 +49,15 @@ # examples within a transaction, remove the following line or assign false # instead of true. # config.use_transactional_fixtures = true - config.before(:suite) do - if is_mongo - ActiveMeta.create_indexes() - Label.create_indexes() - Note.create_indexes(); - end - end - config.before(:each) do Document.delete_all Note.delete_all Watcher.delete_all Attachment.delete_all History.delete_all - if is_mongo - ActiveMeta.delete_all - Label.delete_all - end FileUtils.remove_dir File.expand_path('public/system/') if Dir.exist?(File.expand_path('public/system/')) end config.after(:suite) do # seems that closing the established connection isn't really necessary \ No newline at end of file