fix tests

This commit is contained in:
albert
2011-12-22 18:22:32 -05:00
parent c1c870294c
commit 5ffd6d552a
6 changed files with 26 additions and 25 deletions

View File

@@ -16,16 +16,16 @@ module Moderator
end
should "execute" do
tag_batch_change = TagBatchChange.new("aaa", "bbb")
tag_batch_change.execute
tag_batch_change = TagBatchChange.new("aaa", "bbb", @user, "127.0.0.1")
tag_batch_change.perform
@post.reload
assert_equal("bbb", @post.tag_string)
end
should "raise an error if there is no predicate" do
tag_batch_change = TagBatchChange.new("", "bbb")
tag_batch_change = TagBatchChange.new("", "bbb", @user, "127.0.0.1")
assert_raises(TagBatchChange::Error) do
tag_batch_change.execute
tag_batch_change.perform
end
end
end

View File

@@ -7,6 +7,7 @@ class PostAppealTest < ActiveSupport::TestCase
CurrentUser.user = @alice
CurrentUser.ip_addr = "127.0.0.1"
MEMCACHE.flush_all
Danbooru.config.stubs(:max_appeals_per_day).returns(5)
end
teardown do
@@ -37,7 +38,7 @@ class PostAppealTest < ActiveSupport::TestCase
assert_difference("PostAppeal.count", 0) do
@post_appeal.save
end
assert_equal(["You can appeal 5 posts a day"], @post_appeal.errors.full_messages)
assert_equal(["You can appeal at most 5 post a day"], @post_appeal.errors.full_messages)
end
should "not be able to appeal an active post" do