Merge commit 'c8b9e60ec123c458efff83eedcfd07f067ef05ae' into glitch-soc/merge-upstream
This commit is contained in:
commit
08adca0c63
80 files changed
+1254
-686
No files matched your search
@@ -160,6 +160,36 @@ RSpec.describe 'Notifications' do
|
||||
end
|
||||
end
|
||||
|
||||
context 'when requesting stripped-down accounts' do
|
||||
let(:params) { { expand_accounts: 'partial_avatars' } }
|
||||
|
||||
let(:recent_account) { Fabricate(:account) }
|
||||
|
||||
before do
|
||||
FavouriteService.new.call(recent_account, user.account.statuses.first)
|
||||
end
|
||||
|
||||
it 'returns an account in "partial_accounts", with the expected keys', :aggregate_failures do
|
||||
subject
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json[:partial_accounts].size).to be > 0
|
||||
expect(body_as_json[:partial_accounts][0].keys).to contain_exactly(:acct, :avatar, :avatar_static, :bot, :id, :locked, :url)
|
||||
expect(body_as_json[:partial_accounts].pluck(:id)).to_not include(recent_account.id.to_s)
|
||||
expect(body_as_json[:accounts].pluck(:id)).to include(recent_account.id.to_s)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when passing an invalid value for "expand_accounts"' do
|
||||
let(:params) { { expand_accounts: 'unknown_foobar' } }
|
||||
|
||||
it 'returns http bad request' do
|
||||
subject
|
||||
|
||||
expect(response).to have_http_status(400)
|
||||
end
|
||||
end
|
||||
|
||||
def body_json_types
|
||||
body_as_json[:notification_groups].pluck(:type)
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user