oembed_controller_spec.rb 677 B

12345678910111213141516171819202122232425
  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 http success' do
  13. expect(response).to have_http_status(200)
  14. end
  15. it 'returns private cache control headers' do
  16. expect(response.headers['Cache-Control']).to include('private, no-store')
  17. end
  18. end
  19. end