From a525563eea9c22f8cf4653ef4a0c355ded5a5e55 Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Tue, 31 Jan 2017 14:10:56 +0530 Subject: [PATCH] Optimize spec for ProcessPost job --- spec/jobs/process_post_spec.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/spec/jobs/process_post_spec.rb b/spec/jobs/process_post_spec.rb index edff4c7e8c5..ff085e30aba 100644 --- a/spec/jobs/process_post_spec.rb +++ b/spec/jobs/process_post_spec.rb @@ -48,9 +48,7 @@ describe Jobs::ProcessPost do it "always re-extracts links on post process" do post.update_columns(raw: "sam has a blog at https://samsaffron.com") - TopicLink.destroy_all - Jobs::ProcessPost.new.execute(post_id: post.id) - expect(TopicLink.count).to eq(1) + expect { Jobs::ProcessPost.new.execute(post_id: post.id) }.to change { TopicLink.count }.by(1) end end