Fix extremely slow topic_converter_spec
This commit is contained in:
parent
34f564acd6
commit
bd04b9cbbe
|
@ -124,6 +124,12 @@ describe TopicConverter do
|
||||||
:put,
|
:put,
|
||||||
"https://#{SiteSetting.s3_upload_bucket}.s3.amazonaws.com/original/1X/#{image_upload.sha1}.#{image_upload.extension}?acl"
|
"https://#{SiteSetting.s3_upload_bucket}.s3.amazonaws.com/original/1X/#{image_upload.sha1}.#{image_upload.extension}?acl"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# we need to do this otherwise we get infinite loop shenanigans, as the pull hotlinked
|
||||||
|
# images is never satisfied and keeps calling cooked post processor which in turn runs
|
||||||
|
# pull hotlinked images. we need jobs to run immediately for this spec to work correctly
|
||||||
|
# as the job to convert the uploads to secure must be run.
|
||||||
|
Jobs::PullHotlinkedImages.stubs(:new).returns(Helpers::StubbedJob.new)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "converts regular uploads to secure when making a public post a PM" do
|
it "converts regular uploads to secure when making a public post a PM" do
|
||||||
|
@ -131,11 +137,6 @@ describe TopicConverter do
|
||||||
public_reply.link_post_uploads
|
public_reply.link_post_uploads
|
||||||
public_reply.update_uploads_secure_status
|
public_reply.update_uploads_secure_status
|
||||||
|
|
||||||
# we need to do this otherwise we get infinite loop shenanigans, as the pull hotlinked
|
|
||||||
# images is never satisfied and keeps calling cooked post processor which in turn runs
|
|
||||||
# pull hotlinked images
|
|
||||||
Jobs::PullHotlinkedImages.stubs(:new).returns(Helpers::StubbedJob.new)
|
|
||||||
|
|
||||||
expect(public_reply.uploads[0].secure).to eq(false)
|
expect(public_reply.uploads[0].secure).to eq(false)
|
||||||
public_topic.convert_to_private_message(admin)
|
public_topic.convert_to_private_message(admin)
|
||||||
expect(public_topic.reload.posts.find(public_reply.id).uploads[0].secure).to eq(true)
|
expect(public_topic.reload.posts.find(public_reply.id).uploads[0].secure).to eq(true)
|
||||||
|
|
Loading…
Reference in New Issue