forked from e621ng/e621ng
[Tests] Remove note_count
This commit is contained in:
parent
cfba9a7861
commit
8a6fb57cc2
@ -1488,14 +1488,6 @@ class Post < ApplicationRecord
|
||||
relation
|
||||
end
|
||||
|
||||
def with_note_stats
|
||||
relation = left_outer_joins(:notes).group(:id).select("posts.*")
|
||||
relation = relation.select("COUNT(notes.id) AS note_count")
|
||||
relation = relation.select("COUNT(notes.id) FILTER (WHERE notes.is_active = TRUE) AS active_note_count")
|
||||
relation = relation.select("COUNT(notes.id) FILTER (WHERE notes.is_active = FALSE) AS deleted_note_count")
|
||||
relation
|
||||
end
|
||||
|
||||
def with_flag_stats
|
||||
relation = left_outer_joins(:flags).group(:id).select("posts.*")
|
||||
relation = relation.select("COUNT(post_flags.id) AS flag_count")
|
||||
|
@ -1,7 +1,6 @@
|
||||
class Tag < ApplicationRecord
|
||||
COUNT_METATAGS = %w[
|
||||
comment_count
|
||||
note_count
|
||||
flag_count
|
||||
child_count
|
||||
pool_count
|
||||
|
@ -1674,20 +1674,6 @@ class PostTest < ActiveSupport::TestCase
|
||||
assert_tag_match([posts[1]], "noter:none")
|
||||
end
|
||||
|
||||
should "return posts for the note_count:<N> metatag" do
|
||||
posts = FactoryBot.create_list(:post, 3)
|
||||
FactoryBot.create(:note, post: posts[0], is_active: true)
|
||||
FactoryBot.create(:note, post: posts[1], is_active: false)
|
||||
|
||||
assert_tag_match([posts[1], posts[0]], "note_count:1")
|
||||
assert_tag_match([posts[0]], "active_note_count:1")
|
||||
assert_tag_match([posts[1]], "deleted_note_count:1")
|
||||
|
||||
assert_tag_match([posts[1], posts[0]], "notes:1")
|
||||
assert_tag_match([posts[0]], "active_notes:1")
|
||||
assert_tag_match([posts[1]], "deleted_notes:1")
|
||||
end
|
||||
|
||||
should "return posts for the description:<text> metatag" do
|
||||
posts = FactoryBot.create_list(:post, 2)
|
||||
posts[0].update_attribute(:description, 'abc')
|
||||
|
Loading…
Reference in New Issue
Block a user