From 597e566ee426468a8790442f7f34358fca430c32 Mon Sep 17 00:00:00 2001 From: albert Date: Fri, 1 Mar 2013 06:18:40 -0800 Subject: [PATCH] add test case for pool metatag --- test/unit/post_test.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/unit/post_test.rb b/test/unit/post_test.rb index aec42ffb7..581a693ee 100644 --- a/test/unit/post_test.rb +++ b/test/unit/post_test.rb @@ -369,6 +369,20 @@ class PostTest < ActiveSupport::TestCase end context "for a pool" do + context "on creation" do + setup do + @pool = FactoryGirl.create(:pool) + @post = FactoryGirl.create(:post, :tag_string => "aaa pool:#{@pool.id}") + end + + should "add the post to the pool" do + @post.reload + @pool.reload + assert_equal("#{@post.id}", @pool.post_ids) + assert_equal("pool:#{@pool.id}", @post.pool_string) + end + end + context "id" do setup do @pool = FactoryGirl.create(:pool)