require File.join(File.dirname(__FILE__), 'test_helper') class ActsAsJoinableTest < ActiveSupport::TestCase context "ActsAsJoinable" do setup do create_models(1, 2) end should "have 1 of each post, asset, tag to start" do assert_equal 1, Post.count assert_equal 2, Tag.count assert_equal 2, Asset.count end context "correct generated methods" do setup do @post = Post.first @asset = Asset.first @tag = Tag.first end should "Post should respond_to?(:tags) and respond_to?(:assets)" do puts @post.tags.inspect + " !!" assert @post.respond_to?(:tags) assert @post.respond_to?(:assets) end end teardown do Post.detonate Tag.detonate Asset.detonate end end end