From 0cad5169a322ec796868af7380cd25c6b778c376 Mon Sep 17 00:00:00 2001 From: Tdxdxoz Date: Tue, 28 Mar 2023 16:03:06 +0800 Subject: [PATCH] update tests for not show self-reply --- spec/controllers/accounts_controller_spec.rb | 2 +- spec/controllers/api/v1/accounts/statuses_controller_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/controllers/accounts_controller_spec.rb b/spec/controllers/accounts_controller_spec.rb index 9c38b3032..c2a1c8b1d 100644 --- a/spec/controllers/accounts_controller_spec.rb +++ b/spec/controllers/accounts_controller_spec.rb @@ -322,7 +322,7 @@ RSpec.describe AccountsController, type: :controller do end it 'renders self-reply' do - expect(response.body).to include(ActivityPub::TagManager.instance.url_for(status_self_reply)) + expect(response.body).not_to include(ActivityPub::TagManager.instance.url_for(status_self_reply)) end it 'renders status with media' do diff --git a/spec/controllers/api/v1/accounts/statuses_controller_spec.rb b/spec/controllers/api/v1/accounts/statuses_controller_spec.rb index e57c37179..4f60427f5 100644 --- a/spec/controllers/api/v1/accounts/statuses_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/statuses_controller_spec.rb @@ -48,11 +48,11 @@ describe Api::V1::Accounts::StatusesController do expect(response).to have_http_status(200) end - it 'returns posts along with self replies' do + it 'returns posts without self replies' do json = body_as_json post_ids = json.map { |item| item[:id].to_i }.sort - expect(post_ids).to eq [status.id, status_self_reply.id] + expect(post_ids).to eq [status.id] end end