0
0
Fork 0

Pull out https/hostname setup for request specs to shared config (#31622)

This commit is contained in:
Matt Jankowski 2024-09-03 11:28:57 -04:00 committed by GitHub
parent dc2f67f69b
commit ef4920c6c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 21 additions and 11 deletions

View file

@ -4,12 +4,7 @@ require 'rails_helper'
describe 'Media Proxy' do
describe 'GET /media_proxy/:id' do
before do
integration_session.https! # TODO: Move to global rails_helper for all request specs?
host! Rails.configuration.x.local_domain # TODO: Move to global rails_helper for all request specs?
stub_request(:get, 'http://example.com/attachment.png').to_return(request_fixture('avatar.txt'))
end
before { stub_attachment_request }
context 'when attached to a status' do
let(:status) { Fabricate(:status) }
@ -63,5 +58,15 @@ describe 'Media Proxy' do
.to have_http_status(404)
end
end
def stub_attachment_request
stub_request(
:get,
'http://example.com/attachment.png'
)
.to_return(
request_fixture('avatar.txt')
)
end
end
end