change how tag counts are recalculated after a tag category changes

This commit is contained in:
albert
2013-03-12 12:26:25 -04:00
parent a6ed8bcaf1
commit 687a775fdf
4 changed files with 32 additions and 17 deletions

View File

@@ -91,9 +91,11 @@ class TagTest < ActiveSupport::TestCase
should "reset its category after updating" do
tag = FactoryGirl.create(:artist_tag)
tag.update_category_cache_for_all
assert_equal(Tag.categories.artist, MEMCACHE.get("tc:#{tag.name}"))
tag.update_attribute(:category, Tag.categories.copyright)
tag.update_category_cache_for_all
assert_equal(Tag.categories.copyright, MEMCACHE.get("tc:#{tag.name}"))
end
end