Add the has_many_polymorphs plugin
[cs356-p2-videostore.git] / vendor / plugins / has_many_polymorphs / generators / commenting / templates / comment_test.rb
diff --git a/vendor/plugins/has_many_polymorphs/generators/commenting/templates/comment_test.rb b/vendor/plugins/has_many_polymorphs/generators/commenting/templates/comment_test.rb
new file mode 100644 (file)
index 0000000..b04c9ce
--- /dev/null
@@ -0,0 +1,12 @@
+require File.dirname(__FILE__) + '/../test_helper'
+
+class CommentTest < Test::Unit::TestCase
+  fixtures :comments, :commentings, <%= commentable_models[0..1].join(", ") -%>
+
+  def test_to_s
+    assert_equal "no1@nowhere.com", <%= model_two -%>.find(2).comments.first.email
+    assert_equal "http://letrails.cn", <%= model_two -%>.find(2).comments.last.url
+    assert_equal "http://fr.ivolo.us", <%= model_two -%>.find(2).comments.first.url
+  end
+  
+end