oembed_controller_spec.rb 656 B

12345678910111213141516171819202122
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe Api::OEmbedController do
  4. render_views
  5. let(:alice) { Fabricate(:account, username: 'alice') }
  6. let(:status) { Fabricate(:status, text: 'Hello world', account: alice) }
  7. describe 'GET #show' do
  8. before do
  9. request.host = Rails.configuration.x.local_domain
  10. get :show, params: { url: short_account_status_url(alice, status) }, format: :json
  11. end
  12. it 'returns private cache control headers', :aggregate_failures do
  13. expect(response).to have_http_status(200)
  14. expect(response.headers['Cache-Control']).to include('private, no-store')
  15. end
  16. end
  17. end