闭社主体 forked from https://github.com/tootsuite/mastodon
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.

38 lines
1.1 KiB

  1. require 'rails_helper'
  2. describe Api::V1::Accounts::StatusesController do
  3. render_views
  4. let(:user) { Fabricate(:user, account: Fabricate(:account, username: 'alice')) }
  5. let(:token) { double acceptable?: true, resource_owner_id: user.id }
  6. before do
  7. allow(controller).to receive(:doorkeeper_token) { token }
  8. Fabricate(:status, account: user.account)
  9. end
  10. describe 'GET #index' do
  11. it 'returns http success' do
  12. get :index, params: { account_id: user.account.id, limit: 1 }
  13. expect(response).to have_http_status(:success)
  14. expect(response.headers['Link'].links.size).to eq(2)
  15. end
  16. end
  17. describe 'GET #index with only media' do
  18. it 'returns http success' do
  19. get :index, params: { account_id: user.account.id, only_media: true }
  20. expect(response).to have_http_status(:success)
  21. end
  22. end
  23. describe 'GET #index with exclude replies' do
  24. it 'returns http success' do
  25. get :index, params: { account_id: user.account.id, exclude_replies: true }
  26. expect(response).to have_http_status(:success)
  27. end
  28. end
  29. end