fixed unit tests
This commit is contained in:
@@ -2,7 +2,7 @@ require 'fileutils'
|
||||
|
||||
Factory.define(:upload) do |f|
|
||||
f.rating "s"
|
||||
f.uploader {|x| x.association(:user)}
|
||||
f.uploader {|x| x.association(:user, :is_contributor => true)}
|
||||
f.uploader_ip_addr "127.0.0.1"
|
||||
f.tag_string "special"
|
||||
f.status "pending"
|
||||
|
||||
@@ -147,11 +147,11 @@ class BanTest < ActiveSupport::TestCase
|
||||
|
||||
user = Factory.create(:user)
|
||||
ban = Factory.create(:ban, :user => user, :banner => admin, :duration => -1)
|
||||
assert(!Ban.is_user_banned?(user))
|
||||
assert(!Ban.is_banned?(user))
|
||||
|
||||
user = Factory.create(:user)
|
||||
ban = Factory.create(:ban, :user => user, :banner => admin, :duration => 1)
|
||||
assert(Ban.is_user_banned?(user))
|
||||
assert(Ban.is_banned?(user))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -125,7 +125,7 @@ class UploadTest < ActiveSupport::TestCase
|
||||
assert_equal(110, post.image_height)
|
||||
assert_equal(8558, post.file_size)
|
||||
assert_equal(post.id, @upload.post_id)
|
||||
assert_equal("finished", @upload.status)
|
||||
assert_equal("completed", @upload.status)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -151,6 +151,6 @@ class UploadTest < ActiveSupport::TestCase
|
||||
assert(File.exists?(post.file_path))
|
||||
assert_equal(28086, File.size(post.file_path))
|
||||
assert_equal(post.id, @upload.post_id)
|
||||
assert_equal("finished", @upload.status)
|
||||
assert_equal("completed", @upload.status)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user