parent
3e8b4752a1
commit
903b9ad347
7 changed files with 31 additions and 2 deletions
|
@ -256,7 +256,8 @@ RSpec.describe Account do
|
|||
|
||||
describe '#allow_emoji_reaction?' do
|
||||
let(:policy) { :allow }
|
||||
let(:reactioned) { Fabricate(:user, settings: { emoji_reaction_policy: policy }).account }
|
||||
let(:allow_local) { false }
|
||||
let(:reactioned) { Fabricate(:user, settings: { emoji_reaction_policy: policy, slip_local_emoji_reaction: allow_local }).account }
|
||||
let(:followee) { Fabricate(:account) }
|
||||
let(:follower) { Fabricate(:account) }
|
||||
let(:mutual) { Fabricate(:account) }
|
||||
|
@ -411,6 +412,21 @@ RSpec.describe Account do
|
|||
end
|
||||
end
|
||||
|
||||
context 'when policy is block but allow local only' do
|
||||
let(:policy) { :block }
|
||||
let(:allow_local) { true }
|
||||
let(:local) { Fabricate(:user).account }
|
||||
let(:remote) { Fabricate(:account, domain: 'example.com', uri: 'https://example.com/actor') }
|
||||
|
||||
it 'does not allow remote' do
|
||||
expect(reactioned.allow_emoji_reaction?(remote)).to be false
|
||||
end
|
||||
|
||||
it 'allows local' do
|
||||
expect(reactioned.allow_emoji_reaction?(local)).to be true
|
||||
end
|
||||
end
|
||||
|
||||
context 'when reactioned is remote user' do
|
||||
let(:reactioned) { Fabricate(:account, domain: 'foo.bar', uri: 'https://foo.bar/actor', settings: { emoji_reaction_policy: :following_only }) }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue