test/test_helper.rb in acts-as-joinable-0.0.1.7 vs test/test_helper.rb in acts-as-joinable-0.0.6
- old
+ new
@@ -6,33 +6,33 @@
require 'active_support/test_case'
require 'active_record'
require 'active_record/fixtures'
require 'shoulda'
require 'shoulda/active_record'
+require 'logger'
this = File.expand_path(File.dirname(__FILE__))
-# ActiveRecord::Base.logger = Logger.new(STDOUT)
+#ActiveRecord::Base.logger = Logger.new(STDOUT)
require File.expand_path(File.join(this, '/../lib/acts-as-joinable'))
require File.join(this, "database")
ActsAsJoinable.models = Dir["#{this}/lib/*.rb"].collect { |f| File.basename f, '.rb' }
Dir["#{File.dirname(__FILE__)}/../app/models/*"].each { |c| require c if File.extname(c) == ".rb" }
Dir["#{this}/lib/*"].each { |c| require c if File.extname(c) == ".rb" }
+require "#{this}/lib/group"
ActiveRecord::Base.class_eval do
def self.detonate
all.map(&:destroy)
end
end
ActiveSupport::TestCase.class_eval do
-
-
def create_models(parent = 1, child = 2)
return unless Post.all.empty?
parent.times do |i|
post = Post.create!(:title => "title-#{i.to_s}")
child.times do |j|
@@ -50,7 +50,9 @@
Post.detonate
Tag.detonate
Asset.detonate
Page.detonate
ActsAsJoinable::Relationship.detonate
+ Group.detonate
+ Asset.detonate
end
end
\ No newline at end of file