Add coverage for blocked account scenario in following/followers (#36042)
This commit is contained in:
parent
f118d61334
commit
53be8392ec
@ -68,6 +68,26 @@ RSpec.describe FollowerAccountsController do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when request is signed in and user blocks an account' do
|
||||||
|
let(:account) { Fabricate :account }
|
||||||
|
|
||||||
|
before do
|
||||||
|
Fabricate :block, account:, target_account: follower_bob
|
||||||
|
sign_in(account.user)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'returns followers without blocked' do
|
||||||
|
expect(response)
|
||||||
|
.to have_http_status(200)
|
||||||
|
expect(response.parsed_body)
|
||||||
|
.to include(
|
||||||
|
orderedItems: contain_exactly(
|
||||||
|
include(follow_from_chris.account.id.to_s)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context 'when account is permanently suspended' do
|
context 'when account is permanently suspended' do
|
||||||
before do
|
before do
|
||||||
alice.suspend!
|
alice.suspend!
|
||||||
|
|||||||
@ -68,6 +68,26 @@ RSpec.describe FollowingAccountsController do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when request is signed in and user blocks an account' do
|
||||||
|
let(:account) { Fabricate :account }
|
||||||
|
|
||||||
|
before do
|
||||||
|
Fabricate :block, account:, target_account: followee_bob
|
||||||
|
sign_in(account.user)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'returns followers without blocked' do
|
||||||
|
expect(response)
|
||||||
|
.to have_http_status(200)
|
||||||
|
expect(response.parsed_body)
|
||||||
|
.to include(
|
||||||
|
orderedItems: contain_exactly(
|
||||||
|
include(follow_of_chris.target_account.id.to_s)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context 'when account is permanently suspended' do
|
context 'when account is permanently suspended' do
|
||||||
before do
|
before do
|
||||||
alice.suspend!
|
alice.suspend!
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user