From a1049e93807f57796eb6229f2dd1388be8b18225 Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Mon, 16 Apr 2018 17:04:31 +0900 Subject: Redirect to account status page for page of status stream entry (#7104) Commit 519119f657cf97ec187008a28dba00c1125a9292 missed a change for stream entry page. Instead of duplicating the change, redirect to account status page. It would also help crawlers (of search engines, for example) to understand a stream entry URL and its corresponding status URL points to the same page. --- spec/controllers/stream_entries_controller_spec.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'spec/controllers') diff --git a/spec/controllers/stream_entries_controller_spec.rb b/spec/controllers/stream_entries_controller_spec.rb index f81e2be7b..665c5b747 100644 --- a/spec/controllers/stream_entries_controller_spec.rb +++ b/spec/controllers/stream_entries_controller_spec.rb @@ -66,16 +66,12 @@ RSpec.describe StreamEntriesController, type: :controller do describe 'GET #show' do include_examples 'before_action', :show - it 'renders with HTML' do - ancestor = Fabricate(:status) - status = Fabricate(:status, in_reply_to_id: ancestor.id) - descendant = Fabricate(:status, in_reply_to_id: status.id) + it 'redirects to status page' do + status = Fabricate(:status) get :show, params: { account_username: status.account.username, id: status.stream_entry.id } - expect(assigns(:ancestors)).to eq [ancestor] - expect(assigns(:descendants)).to eq [descendant] - expect(response).to have_http_status(:success) + expect(response).to redirect_to(short_account_status_url(status.account, status)) end it 'returns http success with Atom' do -- cgit