Add follow request banner on account header (#20785)
* Add requested_by to relationship maps * Display whether an account has requested to follow you on their profile
This commit is contained in:
@ -10,6 +10,7 @@ RSpec.describe AccountRelationshipsPresenter do
|
||||
allow(Account).to receive(:blocking_map).with(account_ids, current_account_id).and_return(default_map)
|
||||
allow(Account).to receive(:muting_map).with(account_ids, current_account_id).and_return(default_map)
|
||||
allow(Account).to receive(:requested_map).with(account_ids, current_account_id).and_return(default_map)
|
||||
allow(Account).to receive(:requested_by_map).with(account_ids, current_account_id).and_return(default_map)
|
||||
allow(Account).to receive(:domain_blocking_map).with(account_ids, current_account_id).and_return(default_map)
|
||||
end
|
||||
|
||||
@ -71,6 +72,14 @@ RSpec.describe AccountRelationshipsPresenter do
|
||||
end
|
||||
end
|
||||
|
||||
context 'options[:requested_by_map] is set' do
|
||||
let(:options) { { requested_by_map: { 6 => true } } }
|
||||
|
||||
it 'sets @requested merged with default_map and options[:requested_by_map]' do
|
||||
expect(presenter.requested_by).to eq default_map.merge(options[:requested_by_map])
|
||||
end
|
||||
end
|
||||
|
||||
context 'options[:domain_blocking_map] is set' do
|
||||
let(:options) { { domain_blocking_map: { 7 => true } } }
|
||||
|
||||
|
Reference in New Issue
Block a user