Pull out https/hostname setup for request specs to shared config (#31622)
This commit is contained in:
parent
dc2f67f69b
commit
ef4920c6c9
5 changed files with 21 additions and 11 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue