From 6f2a3cb026d5c596f2dfd9d851fa6beb7fbd35ca Mon Sep 17 00:00:00 2001 From: Vinoth Kannan Date: Thu, 16 Nov 2017 15:20:44 +0530 Subject: [PATCH] Remove unwanted triggers to `CookedPostProcessor` (#5319) --- spec/jobs/pull_hotlinked_images_spec.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/spec/jobs/pull_hotlinked_images_spec.rb b/spec/jobs/pull_hotlinked_images_spec.rb index 395b7e53a8e..3447fd00796 100644 --- a/spec/jobs/pull_hotlinked_images_spec.rb +++ b/spec/jobs/pull_hotlinked_images_spec.rb @@ -15,6 +15,7 @@ describe Jobs::PullHotlinkedImages do stub_request(:head, broken_image_url).to_return(status: 404) stub_request(:get, large_image_url).to_return(body: large_png, headers: { "Content-Type" => "image/png" }) stub_request(:head, large_image_url) + SiteSetting.crawl_images = true SiteSetting.download_remote_images_to_local = true SiteSetting.max_image_size_kb = 2 SiteSetting.download_remote_images_threshold = 0 @@ -96,10 +97,8 @@ describe Jobs::PullHotlinkedImages do it 'replaces image src' do post = Fabricate(:post, raw: "#{url}") - Jobs::ProcessPost.new.execute(post_id: post.id) Jobs::PullHotlinkedImages.new.execute(post_id: post.id) Jobs::ProcessPost.new.execute(post_id: post.id) - post.reload expect(post.cooked).to match(/ ") - Jobs::ProcessPost.new.execute(post_id: post.id) Jobs::PullHotlinkedImages.new.execute(post_id: post.id) Jobs::ProcessPost.new.execute(post_id: post.id) Jobs::PullHotlinkedImages.new.execute(post_id: post.id) @@ -131,7 +129,6 @@ describe Jobs::PullHotlinkedImages do it 'broken image with placeholder' do post = Fabricate(:post, raw: "") - Jobs::ProcessPost.new.execute(post_id: post.id) Jobs::PullHotlinkedImages.new.execute(post_id: post.id) post.reload @@ -141,9 +138,7 @@ describe Jobs::PullHotlinkedImages do it 'large image with placeholder' do post = Fabricate(:post, raw: "") - Jobs::ProcessPost.new.execute(post_id: post.id) Jobs::PullHotlinkedImages.new.execute(post_id: post.id) - Jobs::ProcessPost.new.execute(post_id: post.id) post.reload expect(post.cooked).to match(/
/)