This commit is contained in:
r888888888
2014-03-05 17:33:57 -08:00
parent 093d2fc783
commit 14dd0430cb
3 changed files with 38 additions and 6 deletions

View File

@@ -13,6 +13,26 @@ class UserTest < ActiveSupport::TestCase
CurrentUser.user = nil
CurrentUser.ip_addr = nil
end
context "promoting a user" do
setup do
CurrentUser.user = FactoryGirl.create(:moderator_user)
end
should "create a transaction log item" do
assert_difference("TransactionLogItem.count") do
@user.promote_to!(User::Levels::GOLD)
end
end
should "create a neutral feedback" do
assert_difference("UserFeedback.count") do
@user.promote_to!(User::Levels::GOLD)
end
assert_equal("Promoted by #{CurrentUser.user.name} from Member to Gold", @user.feedback.last.body)
end
end
context "favoriting a post" do
setup do