parent
ac65d05df5
commit
aefe147c2b
9 changed files with 10 additions and 44 deletions
|
@ -397,13 +397,9 @@ RSpec.describe Account do
|
|||
describe '#public_settings_for_local' do
|
||||
subject { account.public_settings_for_local }
|
||||
|
||||
let(:account) { Fabricate(:user, settings: { link_preview: false, allow_quote: true, hide_statuses_count: true, emoji_reaction_policy: :followers_only }).account }
|
||||
let(:account) { Fabricate(:user, settings: { allow_quote: true, hide_statuses_count: true, emoji_reaction_policy: :followers_only }).account }
|
||||
|
||||
shared_examples 'some settings' do |permitted, emoji_reaction_policy|
|
||||
it 'link_preview is disallowed' do
|
||||
expect(subject['link_preview']).to be permitted.include?(:link_preview)
|
||||
end
|
||||
|
||||
it 'allow_quote is allowed' do
|
||||
expect(subject['allow_quote']).to be permitted.include?(:allow_quote)
|
||||
end
|
||||
|
@ -423,8 +419,14 @@ RSpec.describe Account do
|
|||
|
||||
it_behaves_like 'some settings', %i(allow_quote hide_statuses_count), 'followers_only'
|
||||
|
||||
context 'when default true setting is set false' do
|
||||
let(:account) { Fabricate(:user, settings: { allow_quote: false, hide_statuses_count: true, emoji_reaction_policy: :followers_only }).account }
|
||||
|
||||
it_behaves_like 'some settings', %i(hide_statuses_count), 'followers_only'
|
||||
end
|
||||
|
||||
context 'when remote user' do
|
||||
let(:account) { Fabricate(:account, domain: 'example.com', uri: 'https://example.com/actor', settings: { 'link_preview' => false, 'allow_quote' => true, 'hide_statuses_count' => true, 'emoji_reaction_policy' => 'followers_only' }) }
|
||||
let(:account) { Fabricate(:account, domain: 'example.com', uri: 'https://example.com/actor', settings: { 'allow_quote' => true, 'hide_statuses_count' => true, 'emoji_reaction_policy' => 'followers_only' }) }
|
||||
|
||||
it_behaves_like 'some settings', %i(allow_quote hide_statuses_count), 'followers_only'
|
||||
end
|
||||
|
@ -432,7 +434,7 @@ RSpec.describe Account do
|
|||
context 'when remote user by server other_settings is not supported' do
|
||||
let(:account) { Fabricate(:account, domain: 'example.com', uri: 'https://example.com/actor') }
|
||||
|
||||
it_behaves_like 'some settings', %i(link_preview allow_quote), 'allow'
|
||||
it_behaves_like 'some settings', %i(allow_quote), 'allow'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue