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
|
||||
|
||||
|
|
|
@ -253,15 +253,6 @@ RSpec.describe FetchLinkCardService, type: :service do
|
|||
expect(status.preview_card.title).to eq 'Hello world'
|
||||
end
|
||||
end
|
||||
|
||||
context 'with URL but author is not allow preview card' do
|
||||
let(:account) { Fabricate(:user, settings: { link_preview: false }).account }
|
||||
let(:status) { Fabricate(:status, text: 'http://example.com/html', account: account) }
|
||||
|
||||
it 'not create preview card' do
|
||||
expect(status.preview_card).to be_nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'with a remote status' do
|
||||
|
@ -282,14 +273,6 @@ RSpec.describe FetchLinkCardService, type: :service do
|
|||
it 'ignores URLs to hashtags' do
|
||||
expect(a_request(:get, 'https://quitter.se/tag/wannacry')).to_not have_been_made
|
||||
end
|
||||
|
||||
context 'with URL but author is not allow preview card' do
|
||||
let(:account) { Fabricate(:account, domain: 'example.com', settings: { link_preview: false }) }
|
||||
|
||||
it 'not create link preview' do
|
||||
expect(status.preview_card).to be_nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'with a remote status of reference' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue