From 64ec4a6a1bdaadf600a1e3913802b8cb3ee8bd2a Mon Sep 17 00:00:00 2001 From: Vinoth Kannan Date: Thu, 4 Apr 2019 21:53:58 +0530 Subject: [PATCH] fix the EnsurePostUploadsExistence job spec --- spec/jobs/ensure_post_uploads_existence_spec.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/spec/jobs/ensure_post_uploads_existence_spec.rb b/spec/jobs/ensure_post_uploads_existence_spec.rb index e057c0b883f..2e8a9f9ede3 100644 --- a/spec/jobs/ensure_post_uploads_existence_spec.rb +++ b/spec/jobs/ensure_post_uploads_existence_spec.rb @@ -15,14 +15,12 @@ describe Jobs::EnsurePostUploadsExistence do expect(field.value).to eq(upload.url) end - it 'should not create post custom fields' do + it 'should create post custom field with nil value' do post = Fabricate(:post, cooked: "A sample post ") - - expect { - described_class.new.execute({}) - }.not_to change { - PostCustomField.count - } + described_class.new.execute({}) + field = PostCustomField.last + expect(field.name).to eq(Jobs::EnsurePostUploadsExistence::MISSING_UPLOADS) + expect(field.value).to eq(nil) end end end