1
0
Fork 0
forked from gitea/nas

Merge remote-tracking branch 'parent/main' into upstream-20240906

This commit is contained in:
KMY 2024-09-09 08:47:15 +09:00
commit 218cb37fe3
176 changed files with 750 additions and 603 deletions

View file

@ -17,7 +17,7 @@ RSpec.describe '/api/v1/accounts' do
get '/api/v1/accounts', headers: headers, params: { id: [account.id, other_account.id, 123_123] }
expect(response).to have_http_status(200)
expect(body_as_json).to contain_exactly(
expect(response.parsed_body).to contain_exactly(
hash_including(id: account.id.to_s),
hash_including(id: other_account.id.to_s)
)
@ -32,7 +32,7 @@ RSpec.describe '/api/v1/accounts' do
get "/api/v1/accounts/#{account.id}"
expect(response).to have_http_status(200)
expect(body_as_json[:id]).to eq(account.id.to_s)
expect(response.parsed_body[:id]).to eq(account.id.to_s)
end
end
@ -41,7 +41,7 @@ RSpec.describe '/api/v1/accounts' do
get '/api/v1/accounts/1'
expect(response).to have_http_status(404)
expect(body_as_json[:error]).to eq('Record not found')
expect(response.parsed_body[:error]).to eq('Record not found')
end
end
@ -57,7 +57,7 @@ RSpec.describe '/api/v1/accounts' do
subject
expect(response).to have_http_status(200)
expect(body_as_json[:id]).to eq(account.id.to_s)
expect(response.parsed_body[:id]).to eq(account.id.to_s)
end
it_behaves_like 'forbidden for wrong scope', 'write:statuses'
@ -80,7 +80,7 @@ RSpec.describe '/api/v1/accounts' do
subject
expect(response).to have_http_status(200)
expect(body_as_json[:access_token]).to_not be_blank
expect(response.parsed_body[:access_token]).to_not be_blank
user = User.find_by(email: 'hello@world.tld')
expect(user).to_not be_nil
@ -122,7 +122,7 @@ RSpec.describe '/api/v1/accounts' do
expect(response).to have_http_status(200)
expect(body_as_json)
expect(response.parsed_body)
.to include(
following: true,
requested: false
@ -142,7 +142,7 @@ RSpec.describe '/api/v1/accounts' do
expect(response).to have_http_status(200)
expect(body_as_json)
expect(response.parsed_body)
.to include(
following: false,
requested: true
@ -194,7 +194,7 @@ RSpec.describe '/api/v1/accounts' do
it 'changes reblogs option' do
post "/api/v1/accounts/#{other_account.id}/follow", headers: headers, params: { reblogs: true }
expect(body_as_json).to include({
expect(response.parsed_body).to include({
following: true,
showing_reblogs: true,
notifying: false,
@ -204,7 +204,7 @@ RSpec.describe '/api/v1/accounts' do
it 'changes notify option' do
post "/api/v1/accounts/#{other_account.id}/follow", headers: headers, params: { notify: true }
expect(body_as_json).to include({
expect(response.parsed_body).to include({
following: true,
showing_reblogs: false,
notifying: true,
@ -214,7 +214,7 @@ RSpec.describe '/api/v1/accounts' do
it 'changes languages option' do
post "/api/v1/accounts/#{other_account.id}/follow", headers: headers, params: { languages: %w(en es) }
expect(body_as_json).to include({
expect(response.parsed_body).to include({
following: true,
showing_reblogs: false,
notifying: false,