From 66ed7ea4b5a5c022da94eca9cb5931eb4151080d Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 23 Sep 2024 05:20:43 -0400 Subject: [PATCH] Move status creation to "with rss" context in accounts request spec (#32020) --- spec/requests/accounts_spec.rb | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/spec/requests/accounts_spec.rb b/spec/requests/accounts_spec.rb index e657ae606..afd9ac80e 100644 --- a/spec/requests/accounts_spec.rb +++ b/spec/requests/accounts_spec.rb @@ -46,21 +46,6 @@ RSpec.describe 'Accounts show response' do describe 'GET to short username paths' do context 'with existing statuses' do - let!(:status) { Fabricate(:status, account: account) } - let!(:status_reply) { Fabricate(:status, account: account, thread: Fabricate(:status)) } - let!(:status_self_reply) { Fabricate(:status, account: account, thread: status) } - let!(:status_media) { Fabricate(:status, account: account) } - let!(:status_pinned) { Fabricate(:status, account: account) } - let!(:status_private) { Fabricate(:status, account: account, visibility: :private) } - let!(:status_direct) { Fabricate(:status, account: account, visibility: :direct) } - let!(:status_reblog) { Fabricate(:status, account: account, reblog: Fabricate(:status)) } - - before do - status_media.media_attachments << Fabricate(:media_attachment, account: account, type: :image) - account.pinned_statuses << status_pinned - account.pinned_statuses << status_private - end - context 'with HTML' do let(:format) { 'html' } @@ -207,6 +192,21 @@ RSpec.describe 'Accounts show response' do context 'with RSS' do let(:format) { 'rss' } + let!(:status) { Fabricate(:status, account: account) } + let!(:status_reply) { Fabricate(:status, account: account, thread: Fabricate(:status)) } + let!(:status_self_reply) { Fabricate(:status, account: account, thread: status) } + let!(:status_media) { Fabricate(:status, account: account) } + let!(:status_pinned) { Fabricate(:status, account: account) } + let!(:status_private) { Fabricate(:status, account: account, visibility: :private) } + let!(:status_direct) { Fabricate(:status, account: account, visibility: :direct) } + let!(:status_reblog) { Fabricate(:status, account: account, reblog: Fabricate(:status)) } + + before do + status_media.media_attachments << Fabricate(:media_attachment, account: account, type: :image) + account.pinned_statuses << status_pinned + account.pinned_statuses << status_private + end + context 'with a normal account in an RSS request' do before do get short_account_path(username: account.username, format: format)