From 5172d84946eba2b844a3aee3896e270b59f66695 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 26 Aug 2024 10:37:23 -0400 Subject: [PATCH] Convert `manifest` controller spec to request spec (#31596) --- spec/controllers/manifests_controller_spec.rb | 19 --------------- spec/requests/manifest_spec.rb | 24 +++++++++++++++++++ 2 files changed, 24 insertions(+), 19 deletions(-) delete mode 100644 spec/controllers/manifests_controller_spec.rb create mode 100644 spec/requests/manifest_spec.rb diff --git a/spec/controllers/manifests_controller_spec.rb b/spec/controllers/manifests_controller_spec.rb deleted file mode 100644 index 9279fae024..0000000000 --- a/spec/controllers/manifests_controller_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -describe ManifestsController do - render_views - - describe 'GET #show' do - before do - get :show - end - - it 'returns http success' do - expect(response).to have_http_status(200) - end - - it_behaves_like 'cacheable response' - end -end diff --git a/spec/requests/manifest_spec.rb b/spec/requests/manifest_spec.rb new file mode 100644 index 0000000000..749c4038df --- /dev/null +++ b/spec/requests/manifest_spec.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +require 'rails_helper' + +describe 'Manifest' do + describe 'GET /manifest' do + before { get '/manifest' } + + it 'returns http success' do + expect(response) + .to have_http_status(200) + .and have_attributes( + content_type: match('application/json') + ) + expect(body_as_json) + .to include( + id: '/home', + name: 'Mastodon' + ) + end + + it_behaves_like 'cacheable response' + end +end