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
This commit is contained in:
Daniel Uber 2021-12-02 14:41:27 -06:00 committed by GitHub
parent 39b84f471d
commit c1a3ba99eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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