From af15ba86a0ca96de797124416630ce6ee480825c Mon Sep 17 00:00:00 2001 From: Vinoth Kannan Date: Wed, 10 Apr 2019 19:13:38 +0530 Subject: [PATCH] Fix the build. 8d5c90014268fa9e625930740db2a17e2d018784 --- spec/tasks/posts_spec.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/spec/tasks/posts_spec.rb b/spec/tasks/posts_spec.rb index 5587da2f5aa..5631919fd21 100644 --- a/spec/tasks/posts_spec.rb +++ b/spec/tasks/posts_spec.rb @@ -56,18 +56,17 @@ RSpec.describe "Post rake tasks" do end describe 'missing_uploads' do - let(:upload) { Fabricate(:upload) } - let(:optimized) { Fabricate(:optimized_image, url: '/uploads/default/optimized/1X/d1c2d40ab994e8410c_100x200.png') } + let(:url) { "/uploads/#{RailsMultisite::ConnectionManagement.current_db}/original/1X/d1c2d40ab994e8410c.png" } + let(:upload) { Fabricate(:upload, url: url) } it 'should create post custom field for missing upload' do - Fabricate(:post, cooked: "A sample post ") + post = Fabricate(:post, raw: "A sample post ") upload.destroy! Rake::Task['posts:missing_uploads'].invoke - field = PostCustomField.find_by(name: "missing_uploads") - expect(field).to be_present - expect(field.value).to eq(upload.url) + post.reload + expect(post.custom_fields[Post::MISSING_UPLOADS]).to eq([url]) end end end