You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
1015 B

  1. require 'rails_helper'
  2. RSpec.describe StreamEntriesController, type: :controller do
  3. render_views
  4. let(:alice) { Fabricate(:account, username: 'alice') }
  5. let(:status) { Fabricate(:status, account: alice) }
  6. describe 'GET #show' do
  7. it 'returns http success with HTML' do
  8. get :show, params: { account_username: alice.username, id: status.stream_entry.id }
  9. expect(response).to have_http_status(:success)
  10. end
  11. it 'returns http success with Atom' do
  12. get :show, params: { account_username: alice.username, id: status.stream_entry.id }, format: 'atom'
  13. expect(response).to have_http_status(:success)
  14. end
  15. end
  16. describe 'GET #embed' do
  17. it 'returns embedded view of status' do
  18. get :embed, params: { account_username: alice.username, id: status.stream_entry.id }
  19. expect(response).to have_http_status(:success)
  20. expect(response.headers['X-Frame-Options']).to eq 'ALLOWALL'
  21. expect(response).to render_template(layout: 'embedded')
  22. end
  23. end
  24. end