Merge remote-tracking branch 'parent/main' into upstream-20240926
This commit is contained in:
commit
c905714459
517 changed files with 4284 additions and 3891 deletions
|
@ -17,6 +17,8 @@ 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(response.content_type)
|
||||
.to start_with('application/json')
|
||||
expect(response.parsed_body).to contain_exactly(
|
||||
hash_including(id: account.id.to_s),
|
||||
hash_including(id: other_account.id.to_s)
|
||||
|
@ -32,6 +34,8 @@ RSpec.describe '/api/v1/accounts' do
|
|||
get "/api/v1/accounts/#{account.id}"
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(response.content_type)
|
||||
.to start_with('application/json')
|
||||
expect(response.parsed_body[:id]).to eq(account.id.to_s)
|
||||
end
|
||||
end
|
||||
|
@ -41,6 +45,8 @@ RSpec.describe '/api/v1/accounts' do
|
|||
get '/api/v1/accounts/1'
|
||||
|
||||
expect(response).to have_http_status(404)
|
||||
expect(response.content_type)
|
||||
.to start_with('application/json')
|
||||
expect(response.parsed_body[:error]).to eq('Record not found')
|
||||
end
|
||||
end
|
||||
|
@ -57,6 +63,8 @@ RSpec.describe '/api/v1/accounts' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(response.content_type)
|
||||
.to start_with('application/json')
|
||||
expect(response.parsed_body[:id]).to eq(account.id.to_s)
|
||||
end
|
||||
|
||||
|
@ -80,6 +88,8 @@ RSpec.describe '/api/v1/accounts' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(response.content_type)
|
||||
.to start_with('application/json')
|
||||
expect(response.parsed_body[:access_token]).to_not be_blank
|
||||
|
||||
user = User.find_by(email: 'hello@world.tld')
|
||||
|
@ -93,6 +103,8 @@ RSpec.describe '/api/v1/accounts' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(422)
|
||||
expect(response.content_type)
|
||||
.to start_with('application/json')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -121,6 +133,8 @@ RSpec.describe '/api/v1/accounts' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(response.content_type)
|
||||
.to start_with('application/json')
|
||||
|
||||
expect(response.parsed_body)
|
||||
.to include(
|
||||
|
@ -141,6 +155,8 @@ RSpec.describe '/api/v1/accounts' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(response.content_type)
|
||||
.to start_with('application/json')
|
||||
|
||||
expect(response.parsed_body)
|
||||
.to include(
|
||||
|
@ -240,6 +256,8 @@ RSpec.describe '/api/v1/accounts' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(response.content_type)
|
||||
.to start_with('application/json')
|
||||
expect(user.account.following?(other_account)).to be false
|
||||
end
|
||||
|
||||
|
@ -262,6 +280,8 @@ RSpec.describe '/api/v1/accounts' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(response.content_type)
|
||||
.to start_with('application/json')
|
||||
expect(user.account.followed_by?(other_account)).to be false
|
||||
end
|
||||
|
||||
|
@ -284,6 +304,8 @@ RSpec.describe '/api/v1/accounts' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(response.content_type)
|
||||
.to start_with('application/json')
|
||||
expect(user.account.following?(other_account)).to be false
|
||||
expect(user.account.blocking?(other_account)).to be true
|
||||
end
|
||||
|
@ -307,6 +329,8 @@ RSpec.describe '/api/v1/accounts' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(response.content_type)
|
||||
.to start_with('application/json')
|
||||
expect(user.account.blocking?(other_account)).to be false
|
||||
end
|
||||
|
||||
|
@ -329,6 +353,8 @@ RSpec.describe '/api/v1/accounts' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(response.content_type)
|
||||
.to start_with('application/json')
|
||||
expect(user.account.following?(other_account)).to be true
|
||||
expect(user.account.muting?(other_account)).to be true
|
||||
expect(user.account.muting_notifications?(other_account)).to be true
|
||||
|
@ -353,6 +379,8 @@ RSpec.describe '/api/v1/accounts' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(response.content_type)
|
||||
.to start_with('application/json')
|
||||
expect(user.account.following?(other_account)).to be true
|
||||
expect(user.account.muting?(other_account)).to be true
|
||||
expect(user.account.muting_notifications?(other_account)).to be false
|
||||
|
@ -377,6 +405,8 @@ RSpec.describe '/api/v1/accounts' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(response.content_type)
|
||||
.to start_with('application/json')
|
||||
expect(user.account.following?(other_account)).to be true
|
||||
expect(user.account.muting?(other_account)).to be true
|
||||
expect(user.account.muting_notifications?(other_account)).to be true
|
||||
|
@ -401,6 +431,8 @@ RSpec.describe '/api/v1/accounts' do
|
|||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(response.content_type)
|
||||
.to start_with('application/json')
|
||||
expect(user.account.muting?(other_account)).to be false
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue