From c1a3ba99ebec2e1ca220e9530c26cac7757c690b Mon Sep 17 00:00:00 2001 From: Daniel Uber Date: Thu, 2 Dec 2021 14:41:27 -0600 Subject: [PATCH] Save article (to cache tags) before updating follow points (#15637) Fixes a failure where the follow did not calculate implicit points correctly. The underlying issue was that the factory created `article` did not have a cached_tags value containing `tag.name` saved (`article.tags.pluck(:name)` was correct, but the cached_tags was not). This happens automatically when saving an article from the post editor, and any time we subsequently modify an article. Supersedes #15456 --- spec/workers/follows/update_points_worker_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/workers/follows/update_points_worker_spec.rb b/spec/workers/follows/update_points_worker_spec.rb index 1520dfd0f..ee0b391ce 100644 --- a/spec/workers/follows/update_points_worker_spec.rb +++ b/spec/workers/follows/update_points_worker_spec.rb @@ -20,6 +20,7 @@ RSpec.describe Follows::UpdatePointsWorker, type: :worker do user.follow(second_tag) user.follow(tag) + article.save end it "calculates scores", :aggregate_failures do