FIX: Handle BBCode in migrate_to_s3 task as well.

This commit is contained in:
Guo Xiang Tan
2019-03-22 16:21:43 +08:00
parent eec7822d7c
commit 19c3c25db1
3 changed files with 17 additions and 2 deletions

View File

@ -41,4 +41,14 @@ RSpec.describe DbHelper do
expect(post.reload.cooked).to eq('test')
end
end
describe ".regexp_replace" do
it "should remap columns correctly" do
post = Fabricate(:post, raw: "this is a [img]test[/img] post")
DbHelper.regexp_replace("\\[img\\]test\\[/img\\]", "[img]something[/img]")
expect(post.reload.raw).to include("[img]something[/img]")
end
end
end