add the spec for unused tag count
This commit is contained in:
parent
a319cfe77a
commit
092ad7810d
|
@ -40,6 +40,12 @@ describe Tag do
|
||||||
counts = described_class.tags_by_count_query.where("topics.id = ?", @topics[1].id).count(Tag::COUNT_ARG)
|
counts = described_class.tags_by_count_query.where("topics.id = ?", @topics[1].id).count(Tag::COUNT_ARG)
|
||||||
expect(counts).to eq({@tags[0].name => 1})
|
expect(counts).to eq({@tags[0].name => 1})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "returns unused tags too" do
|
||||||
|
unused = Fabricate(:tag)
|
||||||
|
counts = described_class.tags_by_count_query.count(Tag::COUNT_ARG)
|
||||||
|
expect(counts[unused.name]).to eq(0)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue