Skip to content

Commit

Permalink
AO3-6328 Houndilocks
Browse files Browse the repository at this point in the history
  • Loading branch information
weeklies committed Sep 16, 2023
1 parent d2df25b commit 018d38a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions spec/models/tag_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@
let(:tag) { create(:fandom) }
let!(:work) { create(:work, fandom_string: tag.name) }

before {
before do
Tag.write_redis_to_database
tag.reload
}
end

it "does not write to the database when reading the count" do
tag.taggings_count
Expand Down Expand Up @@ -141,15 +141,17 @@
it "triggers reindexing of tags which aren't used much" do
create(:work, fandom_string: tag.name)

expect{ Tag.write_redis_to_database }.to add_to_reindex_queue(tag.reload, :main)
expect { Tag.write_redis_to_database }
.to add_to_reindex_queue(tag.reload, :main)
end

it "triggers reindexing of tags which are used significantly" do
ArchiveConfig.TAGGINGS_COUNT_MIN_CACHE_COUNT.times do
create(:work, fandom_string: tag.name)
end

expect{ Tag.write_redis_to_database }.to add_to_reindex_queue(tag.reload, :main)
expect { Tag.write_redis_to_database }
.to add_to_reindex_queue(tag.reload, :main)
end
end
end
Expand Down

0 comments on commit 018d38a

Please sign in to comment.