ban fixes

This commit is contained in:
albert
2011-10-27 19:35:43 -04:00
parent 3871188bde
commit 3372a93ef8
6 changed files with 30 additions and 26 deletions

View File

@@ -31,8 +31,8 @@ class PostDisapprovalTest < ActiveSupport::TestCase
end
should "remove the associated post from alice's moderation queue" do
assert(!Post.available_for_moderation.map(&:id).include?(@post_1.id))
assert(Post.available_for_moderation.map(&:id).include?(@post_2.id))
assert(!Post.available_for_moderation(false).map(&:id).include?(@post_1.id))
assert(Post.available_for_moderation(false).map(&:id).include?(@post_2.id))
end
end
@@ -43,8 +43,8 @@ class PostDisapprovalTest < ActiveSupport::TestCase
end
should "not remove the associated post from brittony's moderation queue" do
assert(Post.available_for_moderation.map(&:id).include?(@post_1.id))
assert(Post.available_for_moderation.map(&:id).include?(@post_2.id))
assert(Post.available_for_moderation(false).map(&:id).include?(@post_1.id))
assert(Post.available_for_moderation(false).map(&:id).include?(@post_2.id))
end
end
end

View File

@@ -109,7 +109,7 @@ class UploadTest < ActiveSupport::TestCase
context "resizer" do
teardown do
FileUtils.rm_f(Dir.glob("#{Rails.root}/public/data/thumb/test.*.jpg"))
FileUtils.rm_f(Dir.glob("#{Rails.root}/public/data/preview/test.*.jpg"))
FileUtils.rm_f(Dir.glob("#{Rails.root}/public/data/medium/test.*.jpg"))
FileUtils.rm_f(Dir.glob("#{Rails.root}/public/data/large/test.*.jpg"))
FileUtils.rm_f(Dir.glob("#{Rails.root}/public/data/original/test.*.jpg"))
@@ -121,11 +121,11 @@ class UploadTest < ActiveSupport::TestCase
@upload.calculate_dimensions(@upload.file_path)
assert_nothing_raised {@upload.generate_resizes(@upload.file_path)}
assert(File.exists?(@upload.resized_file_path_for(Danbooru.config.small_image_width)))
assert_equal(5613, File.size(@upload.resized_file_path_for(Danbooru.config.small_image_width)))
assert_equal(5677, File.size(@upload.resized_file_path_for(Danbooru.config.small_image_width)))
assert(File.exists?(@upload.resized_file_path_for(Danbooru.config.medium_image_width)))
assert_equal(42990, File.size(@upload.resized_file_path_for(Danbooru.config.medium_image_width)))
assert_equal(43470, File.size(@upload.resized_file_path_for(Danbooru.config.medium_image_width)))
assert(File.exists?(@upload.resized_file_path_for(Danbooru.config.large_image_width)))
assert_equal(197046, File.size(@upload.resized_file_path_for(Danbooru.config.large_image_width)))
assert_equal(198695, File.size(@upload.resized_file_path_for(Danbooru.config.large_image_width)))
end
end