FIX: Cleaned the commit

Only changing the code I changed, not other tests.
This commit is contained in:
Sigurður Guðbrandsson 2015-02-26 01:24:21 +00:00
parent 73068d5fa3
commit 83f719fb80
1 changed files with 11 additions and 1 deletions

View File

@ -63,13 +63,23 @@ describe UserBadgesController do
it 'grants badges from staff' do it 'grants badges from staff' do
admin = Fabricate(:admin) admin = Fabricate(:admin)
post = create_post
log_in_user admin log_in_user admin
StaffActionLogger.any_instance.expects(:log_badge_grant).once StaffActionLogger.any_instance.expects(:log_badge_grant).once
xhr :post, :create, badge_id: badge.id, username: user.username
xhr :post, :create, badge_id: badge.id,
username: user.username,
reason: Discourse.base_url + post.url
expect(response.status).to eq(200) expect(response.status).to eq(200)
user_badge = UserBadge.find_by(user: user, badge: badge) user_badge = UserBadge.find_by(user: user, badge: badge)
expect(user_badge).to be_present expect(user_badge).to be_present
expect(user_badge.granted_by).to eq(admin) expect(user_badge.granted_by).to eq(admin)
expect(user_badge.post_id).to eq(post.id)
end end
it 'does not grant badges from regular api calls' do it 'does not grant badges from regular api calls' do