increases tag limit to 10
This commit is contained in:
@@ -12,7 +12,7 @@ class TagCloud
|
||||
last_week.tag_counts.
|
||||
where("lower(name) NOT IN (?)", category_names + geozone_names + default_blacklist).
|
||||
order("#{table_name}_count": :desc, name: :asc).
|
||||
limit(5)
|
||||
limit(10)
|
||||
end
|
||||
|
||||
def category_names
|
||||
|
||||
@@ -100,6 +100,14 @@ describe TagCloud do
|
||||
expect(tag_names(tag_cloud).second).to eq 'participation'
|
||||
expect(tag_names(tag_cloud).third).to eq 'corruption'
|
||||
end
|
||||
|
||||
it "returns a maximum of 10 tags" do
|
||||
12.times { |i| create(:proposal, tag_list: "Tag #{i}") }
|
||||
|
||||
tag_cloud = TagCloud.new(Proposal)
|
||||
|
||||
expect(tag_names(tag_cloud).count).to eq(10)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user