Fix test failures when removing posts from deleted pools.
These tests failed because removing posts from deleted pools is now Builder-only.
This commit is contained in:
@@ -149,6 +149,9 @@ class PoolTest < ActiveSupport::TestCase
|
|||||||
|
|
||||||
context "to a deleted pool" do
|
context "to a deleted pool" do
|
||||||
setup do
|
setup do
|
||||||
|
# must be a builder to update deleted pools.
|
||||||
|
CurrentUser.user = FactoryGirl.create(:builder_user)
|
||||||
|
|
||||||
@pool.update_attribute(:is_deleted, true)
|
@pool.update_attribute(:is_deleted, true)
|
||||||
@pool.post_ids = "#{@pool.post_ids} #{@p2.id}"
|
@pool.post_ids = "#{@pool.post_ids} #{@p2.id}"
|
||||||
@pool.synchronize!
|
@pool.synchronize!
|
||||||
|
|||||||
@@ -111,6 +111,9 @@ class PostTest < ActiveSupport::TestCase
|
|||||||
|
|
||||||
context "that belongs to a pool" do
|
context "that belongs to a pool" do
|
||||||
setup do
|
setup do
|
||||||
|
# must be a builder to update deleted pools. must be >1 week old to remove posts from pools.
|
||||||
|
CurrentUser.user = FactoryGirl.create(:builder_user, created_at: 1.month.ago)
|
||||||
|
|
||||||
SqsService.any_instance.stubs(:send_message)
|
SqsService.any_instance.stubs(:send_message)
|
||||||
@pool = FactoryGirl.create(:pool)
|
@pool = FactoryGirl.create(:pool)
|
||||||
@pool.add!(@post)
|
@pool.add!(@post)
|
||||||
|
|||||||
Reference in New Issue
Block a user