Correct invalid spec

This commit is contained in:
Sam 2014-05-30 14:48:07 +10:00
parent 95221ee9c1
commit 106838b92b
1 changed files with 4 additions and 4 deletions

View File

@ -1231,10 +1231,6 @@ describe UsersController do
let!(:user) { log_in } let!(:user) { log_in }
it 'raises an error without an avatar_id param' do
lambda { xhr :put, :pick_avatar, username: user.username }.should raise_error(ActionController::ParameterMissing)
end
it 'raises an error when you don\'t have permission to toggle the avatar' do it 'raises an error when you don\'t have permission to toggle the avatar' do
another_user = Fabricate(:user) another_user = Fabricate(:user)
xhr :put, :pick_avatar, username: another_user.username, upload_id: 1 xhr :put, :pick_avatar, username: another_user.username, upload_id: 1
@ -1245,6 +1241,10 @@ describe UsersController do
xhr :put, :pick_avatar, username: user.username, upload_id: 111 xhr :put, :pick_avatar, username: user.username, upload_id: 111
user.reload.uploaded_avatar_id.should == 111 user.reload.uploaded_avatar_id.should == 111
response.should be_success response.should be_success
xhr :put, :pick_avatar, username: user.username
user.reload.uploaded_avatar_id.should == nil
response.should be_success
end end
end end