tests: drop PostSets::Pool tests.

We no longer use this class for pool show pages. Only used by
inheritance by PostSets::FavoriteGroup.
This commit is contained in:
evazion
2019-08-22 21:07:34 -05:00
parent 6ba3d68792
commit e03f6b9bc0

View File

@@ -1,62 +0,0 @@
require 'test_helper'
module PostSets
class PoolTest < ActiveSupport::TestCase
context "In all cases" do
setup do
@user = FactoryBot.create(:user)
CurrentUser.user = @user
CurrentUser.ip_addr = "127.0.0.1"
mock_pool_archive_service!
start_pool_archive_transaction
@post_1 = FactoryBot.create(:post)
@post_2 = FactoryBot.create(:post)
@post_3 = FactoryBot.create(:post)
@pool = FactoryBot.create(:pool)
@pool.add!(@post_2)
@pool.add!(@post_1)
@pool.add!(@post_3)
end
teardown do
rollback_pool_archive_transaction
CurrentUser.user = nil
CurrentUser.ip_addr = nil
end
context "a post pool set for page 2" do
setup do
@set = PostSets::Pool.new(@pool, 2)
@set.stubs(:limit).returns(1)
end
should "return the second element" do
assert_equal(1, @set.posts.size)
assert_equal(@post_1.id, @set.posts.first.id)
end
should "know the total number of pages" do
assert_equal(3, @set.total_pages)
end
should "know the current page" do
assert_equal(2, @set.current_page)
end
end
context "a post pool set with no page specified" do
setup do
@set = PostSets::Pool.new(@pool)
@set.stubs(:limit).returns(1)
end
should "return the first element" do
assert_equal(1, @set.posts.size)
assert_equal(@post_2.id, @set.posts.first.id)
end
end
end
end
end