fix tests
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user