2022-01-19 22:37:27 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'rails_helper'
|
|
|
|
|
2024-09-04 07:12:25 +02:00
|
|
|
RSpec.describe 'API V1 Statuses Histories' do
|
2022-01-28 00:46:42 +01:00
|
|
|
let(:user) { Fabricate(:user) }
|
2024-01-26 18:45:54 +01:00
|
|
|
let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) }
|
|
|
|
let(:scopes) { 'read:statuses' }
|
|
|
|
let(:headers) { { 'Authorization' => "Bearer #{token.token}" } }
|
2022-01-19 22:37:27 +01:00
|
|
|
|
|
|
|
context 'with an oauth token' do
|
2024-01-26 18:45:54 +01:00
|
|
|
describe 'GET /api/v1/statuses/:status_id/history' do
|
2022-01-19 22:37:27 +01:00
|
|
|
let(:status) { Fabricate(:status, account: user.account) }
|
|
|
|
|
|
|
|
before do
|
2024-01-26 18:45:54 +01:00
|
|
|
get "/api/v1/statuses/#{status.id}/history", headers: headers
|
2022-01-19 22:37:27 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'returns http success' do
|
|
|
|
expect(response).to have_http_status(200)
|
2024-09-20 15:13:04 +02:00
|
|
|
expect(response.content_type)
|
|
|
|
.to start_with('application/json')
|
2024-09-06 11:58:46 +02:00
|
|
|
expect(response.parsed_body.size).to_not be 0
|
2022-01-19 22:37:27 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|