fix tests

This commit is contained in:
r888888888
2016-01-18 17:13:26 -08:00
parent 243368a758
commit ce3af81c9f
11 changed files with 37 additions and 20 deletions

View File

@@ -1034,17 +1034,19 @@ class Post < ActiveRecord::Base
# optimize some cases. these are just estimates but at these
# quantities being off by a few hundred doesn't matter much
if tags == ""
return (Post.maximum(:id) * (2200402.0 / 2232212)).floor
if Danbooru.config.estimate_post_counts
if tags == ""
return (Post.maximum(:id) * (2200402.0 / 2232212)).floor
elsif tags =~ /^rating:s(?:afe)?$/
return (Post.maximum(:id) * (1648652.0 / 2200402)).floor
elsif tags =~ /^rating:s(?:afe)?$/
return (Post.maximum(:id) * (1648652.0 / 2200402)).floor
elsif tags =~ /^rating:q(?:uestionable)?$/
return (Post.maximum(:id) * (350101.0 / 2200402)).floor
elsif tags =~ /^rating:q(?:uestionable)?$/
return (Post.maximum(:id) * (350101.0 / 2200402)).floor
elsif tags =~ /^rating:e(?:xplicit)?$/
return (Post.maximum(:id) * (201650.0 / 2200402)).floor
elsif tags =~ /^rating:e(?:xplicit)?$/
return (Post.maximum(:id) * (201650.0 / 2200402)).floor
end
end
count = get_count_from_cache(tags)