histories_spec.rb 747 B

12345678910111213141516171819202122232425
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe 'API V1 Statuses Histories' do
  4. let(:user) { Fabricate(:user) }
  5. let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) }
  6. let(:scopes) { 'read:statuses' }
  7. let(:headers) { { 'Authorization' => "Bearer #{token.token}" } }
  8. context 'with an oauth token' do
  9. describe 'GET /api/v1/statuses/:status_id/history' do
  10. let(:status) { Fabricate(:status, account: user.account) }
  11. before do
  12. get "/api/v1/statuses/#{status.id}/history", headers: headers
  13. end
  14. it 'returns http success' do
  15. expect(response).to have_http_status(200)
  16. expect(body_as_json.size).to_not be 0
  17. end
  18. end
  19. end
  20. end