mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 14:48:03 +08:00
FEATURE: add profile_background fields into SSO (#5701)
Add profile_background and card_background fields into Discourse SSO.
This commit is contained in:

committed by
Régis Hanol

parent
5a57a454fe
commit
ff6be3c2e3
@ -202,4 +202,39 @@ describe UserProfile do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context '.import_url_for_user' do
|
||||
let(:user) { Fabricate(:user) }
|
||||
|
||||
before do
|
||||
stub_request(:any, "thisfakesomething.something.com")
|
||||
.to_return(body: "abc", status: 404, headers: { 'Content-Length' => 3 })
|
||||
end
|
||||
|
||||
describe 'when profile_background_url returns an invalid status code' do
|
||||
it 'should not do anything' do
|
||||
url = "http://thisfakesomething.something.com/"
|
||||
|
||||
UserProfile.import_url_for_user(url, user, is_card_background: false)
|
||||
|
||||
user.reload
|
||||
|
||||
expect(user.user_profile.profile_background).to eq(nil)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'when card_background_url returns an invalid status code' do
|
||||
it 'should not do anything' do
|
||||
url = "http://thisfakesomething.something.com/"
|
||||
|
||||
UserProfile.import_url_for_user(url, user, is_card_background: true)
|
||||
|
||||
user.reload
|
||||
|
||||
expect(user.user_profile.card_background).to eq(nil)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user