Merge commit '4a22e72b9b1b8f14792efcc649b0db8bc27f0df2' into glitch-soc/merge-upstream

This commit is contained in:
Claire
2023-05-25 22:59:30 +02:00
48 changed files with 1232 additions and 160 deletions

View File

@ -25,7 +25,7 @@ RSpec.describe AccountMigration do
end
end
context 'with unresolveable account' do
context 'with unresolvable account' do
let(:target_acct) { 'target@remote' }
before do

View File

@ -698,7 +698,7 @@ RSpec.describe Account do
expect(subject.match('Check this out https://medium.com/@alice/some-article#.abcdef123')).to be_nil
end
xit 'does not match URL querystring' do
xit 'does not match URL query string' do
expect(subject.match('https://example.com/?x=@alice')).to be_nil
end
end

View File

@ -121,10 +121,17 @@ describe Report do
end
describe 'validations' do
it 'is invalid if comment is longer than 1000 characters' do
let(:remote_account) { Fabricate(:account, domain: 'example.com', protocol: :activitypub, inbox_url: 'http://example.com/inbox') }
it 'is invalid if comment is longer than 1000 characters only if reporter is local' do
report = Fabricate.build(:report, comment: Faker::Lorem.characters(number: 1001))
report.valid?
expect(report.valid?).to be false
expect(report).to model_have_error_on_field(:comment)
end
it 'is valid if comment is longer than 1000 characters and reporter is not local' do
report = Fabricate.build(:report, account: remote_account, comment: Faker::Lorem.characters(number: 1001))
expect(report.valid?).to be true
end
end
end

View File

@ -90,7 +90,7 @@ RSpec.describe UserSettings::Setting do
describe '#key' do
context 'when there is no namespace' do
it 'returnsn a symbol' do
it 'returns a symbol' do
expect(subject.key).to eq :foo
end
end