2023-02-21 17:55:31 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-11-30 15:01:03 -07:00
|
|
|
require 'rails_helper'
|
|
|
|
|
2023-05-03 21:49:53 -06:00
|
|
|
RSpec.describe Api::OEmbedController do
|
2017-05-30 14:30:06 -06:00
|
|
|
render_views
|
|
|
|
|
2017-01-23 05:36:17 -07:00
|
|
|
let(:alice) { Fabricate(:account, username: 'alice') }
|
|
|
|
let(:status) { Fabricate(:status, text: 'Hello world', account: alice) }
|
2016-11-30 15:01:03 -07:00
|
|
|
|
2017-01-23 05:36:17 -07:00
|
|
|
describe 'GET #show' do
|
|
|
|
before do
|
2017-09-02 09:42:47 -06:00
|
|
|
request.host = Rails.configuration.x.local_domain
|
2019-07-07 08:16:51 -06:00
|
|
|
get :show, params: { url: short_account_status_url(alice, status) }, format: :json
|
2017-01-23 05:36:17 -07:00
|
|
|
end
|
|
|
|
|
2023-10-13 06:42:09 -06:00
|
|
|
it 'returns private cache control headers', :aggregate_failures do
|
2018-04-21 13:35:07 -06:00
|
|
|
expect(response).to have_http_status(200)
|
2023-04-19 08:07:29 -06:00
|
|
|
expect(response.headers['Cache-Control']).to include('private, no-store')
|
|
|
|
end
|
2017-01-23 05:36:17 -07:00
|
|
|
end
|
2016-11-30 15:01:03 -07:00
|
|
|
end
|