fix pool controller tests

This commit is contained in:
albert
2011-07-22 18:15:43 -04:00
parent d0e8084f0f
commit c74fa18898
12 changed files with 33 additions and 98 deletions

View File

@@ -23,7 +23,7 @@ class PoolElementsControllerTest < ActionController::TestCase
end
should "add a post to a pool once and only once" do
@pool.add_post!(@post)
@pool.add!(@post)
post :create, {:pool_id => @pool.id, :post_id => @post.id, :format => "json"}, {:user_id => @user.id}
@pool.reload
assert_equal([@post.id], @pool.post_id_array)
@@ -32,7 +32,7 @@ class PoolElementsControllerTest < ActionController::TestCase
context "destroy action" do
setup do
@pool.add_post!(@post)
@pool.add!(@post)
end
should "remove a post from a pool" do
@@ -42,7 +42,7 @@ class PoolElementsControllerTest < ActionController::TestCase
end
should "do nothing if the post is not a member of the pool" do
@pool.remove_post!(@post)
@pool.remove!(@post)
post :destroy, {:pool_id => @pool.id, :post_id => @post.id, :format => "json"}, {:user_id => @user.id}
@pool.reload
assert_equal([], @pool.post_id_array)