mirror of
https://github.com/discourse/discourse.git
synced 2026-08-12 05:55:39 -05:00
move profile_background from User to UserProfile
This commit is contained in:
committed by
Robin Ward
parent
00910679ad
commit
386d1e231a
@@ -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
|
||||
|
||||
|
||||
@@ -32,6 +32,16 @@ describe UserSerializer do
|
||||
end
|
||||
end
|
||||
|
||||
context "with filled out profile background" do
|
||||
before do
|
||||
user.user_profile.profile_background = 'http://background.com'
|
||||
end
|
||||
|
||||
it "has a profile background" do
|
||||
expect(json[:profile_background]).to eq 'http://background.com'
|
||||
end
|
||||
end
|
||||
|
||||
context "with filled out website" do
|
||||
before do
|
||||
user.user_profile.website = 'http://example.com'
|
||||
|
||||
Reference in New Issue
Block a user