mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
SECURITY: rebake old user profiles
This commit is contained in:
parent
3cab3acd60
commit
b11b5cb61b
4 changed files with 57 additions and 1 deletions
|
@ -6,6 +6,20 @@ describe UserProfile do
|
|||
user.user_profile.should be_present
|
||||
end
|
||||
|
||||
describe 'rebaking' do
|
||||
it 'correctly rebakes bio' do
|
||||
user_profile = Fabricate(:evil_trout).user_profile
|
||||
user_profile.update_columns(bio_raw: "test", bio_cooked: "broken", bio_cooked_version: nil)
|
||||
|
||||
problems = UserProfile.rebake_old(10)
|
||||
problems.length.should == 0
|
||||
|
||||
user_profile.reload
|
||||
user_profile.bio_cooked.should == "<p>test</p>"
|
||||
user_profile.bio_cooked_version.should == UserProfile::BAKED_VERSION
|
||||
end
|
||||
end
|
||||
|
||||
describe 'new' do
|
||||
let(:user_profile) { Fabricate.build(:user_profile) }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue