Remove counts from instance API (#16479)

This commit is contained in:
Alex 2022-02-09 11:07:44 -05:00 committed by GitHub
parent 7ea2ecaf7a
commit f071903176
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 6 deletions

View file

@ -5,7 +5,6 @@ module Api
def show
render json: {
comment_count: Comment.estimated_count,
context: ApplicationConfig["FOREM_CONTEXT"],
cover_image_url: Settings::General.main_social_image,
description: Settings::Community.community_description,
@ -13,8 +12,6 @@ module Api
domain: Settings::General.app_domain,
logo_image_url: Settings::General.logo_png,
name: Settings::Community.community_name,
published_article_count: Article.published.estimated_count,
registered_users_count: User.registered.estimated_count,
tagline: Settings::Community.tagline,
version: release_version,
visibility: visibility

View file

@ -6,7 +6,6 @@ RSpec.describe "Api::V0::Instances", type: :request do
create(:user)
get api_instance_path
expect(response.parsed_body["comment_count"]).to eq Comment.estimated_count
expect(response.parsed_body["context"]).to eq ApplicationConfig["FOREM_CONTEXT"]
expect(response.parsed_body["cover_image_url"]).to eq Settings::General.main_social_image
expect(response.parsed_body["description"]).to eq Settings::Community.community_description
@ -14,8 +13,6 @@ RSpec.describe "Api::V0::Instances", type: :request do
expect(response.parsed_body["domain"]).to eq Settings::General.app_domain
expect(response.parsed_body["logo_image_url"]).to eq Settings::General.logo_png
expect(response.parsed_body["name"]).to eq Settings::Community.community_name
expect(response.parsed_body["published_article_count"]).to eq Article.published.estimated_count
expect(response.parsed_body["registered_users_count"]).to eq User.registered.estimated_count
expect(response.parsed_body["tagline"]).to eq Settings::Community.tagline
expect(response.parsed_body["version"]).to match(/(stable|beta|edge)\.\d{8}\.\d+/)
expect(response.parsed_body["visibility"]).to eq "public"