move profile_background from User to UserProfile

This commit is contained in:
Andrew Bezzub
2014-06-11 18:52:50 -07:00
committed by Robin Ward
parent 00910679ad
commit 386d1e231a
8 changed files with 53 additions and 18 deletions

View File

@ -1169,7 +1169,7 @@ describe UsersController do
xhr :post, :upload_user_image, username: user.username, file: user_image, user_image_type: "profile_background"
user.reload
user.profile_background.should == "/uploads/default/1/1234567890123456.png"
user.user_profile.profile_background.should == "/uploads/default/1/1234567890123456.png"
# returns the url, width and height of the uploaded image
json = JSON.parse(response.body)
@ -1218,7 +1218,7 @@ describe UsersController do
Upload.expects(:create_for).returns(upload)
xhr :post, :upload_user_image, username: user.username, file: user_image_url, user_image_type: "profile_background"
user.reload
user.profile_background.should == "/uploads/default/1/1234567890123456.png"
user.user_profile.profile_background.should == "/uploads/default/1/1234567890123456.png"
# returns the url, width and height of the uploaded image
json = JSON.parse(response.body)
@ -1287,7 +1287,7 @@ describe UsersController do
it 'it successful' do
xhr :put, :clear_profile_background, username: user.username
user.reload.profile_background.should == ""
user.reload.user_profile.profile_background.should == ""
response.should be_success
end