add test case for pool metatag

This commit is contained in:
albert
2013-03-01 06:18:40 -08:00
parent 358e78c14b
commit 597e566ee4

View File

@@ -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)