Fix RSpec/MissingExampleGroupArgument cop (#25310)

This commit is contained in:
Matt Jankowski 2023-06-06 09:51:42 -04:00 committed by GitHub
parent b74c3cd708
commit 6c0e3f490a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 38 additions and 68 deletions

View file

@ -20,7 +20,7 @@ RSpec.describe FetchLinkCardService, type: :service do
end
context 'with a local status' do
context do
context 'with an IDN url' do
let(:status) { Fabricate(:status, text: 'Check out http://example.中国') }
it 'works with IDN URLs' do
@ -28,7 +28,7 @@ RSpec.describe FetchLinkCardService, type: :service do
end
end
context do
context 'with an SJIS url' do
let(:status) { Fabricate(:status, text: 'Check out http://example.com/sjis') }
it 'works with SJIS' do
@ -37,7 +37,7 @@ RSpec.describe FetchLinkCardService, type: :service do
end
end
context do
context 'with invalid SJIS url' do
let(:status) { Fabricate(:status, text: 'Check out http://example.com/sjis_with_wrong_charset') }
it 'works with SJIS even with wrong charset header' do
@ -46,7 +46,7 @@ RSpec.describe FetchLinkCardService, type: :service do
end
end
context do
context 'with an koi8-r url' do
let(:status) { Fabricate(:status, text: 'Check out http://example.com/koi8-r') }
it 'works with koi8-r' do
@ -55,7 +55,7 @@ RSpec.describe FetchLinkCardService, type: :service do
end
end
context do
context 'with a windows-1251 url' do
let(:status) { Fabricate(:status, text: 'Check out http://example.com/windows-1251') }
it 'works with windows-1251' do
@ -64,7 +64,7 @@ RSpec.describe FetchLinkCardService, type: :service do
end
end
context do
context 'with a japanese path url' do
let(:status) { Fabricate(:status, text: 'テストhttp://example.com/日本語') }
it 'works with Japanese path string' do
@ -73,7 +73,7 @@ RSpec.describe FetchLinkCardService, type: :service do
end
end
context do
context 'with a hyphen-suffixed url' do
let(:status) { Fabricate(:status, text: 'test http://example.com/test-') }
it 'works with a URL ending with a hyphen' do
@ -81,7 +81,7 @@ RSpec.describe FetchLinkCardService, type: :service do
end
end
context do
context 'with an isolated url' do
let(:status) { Fabricate(:status, text: 'testhttp://example.com/sjis') }
it 'does not fetch URLs with not isolated from their surroundings' do
@ -89,7 +89,7 @@ RSpec.describe FetchLinkCardService, type: :service do
end
end
context do
context 'with a url that has a caret' do
let(:status) { Fabricate(:status, text: 'test http://example.com/test?data=file.gpx^1') }
it 'does fetch URLs with a caret in search params' do

View file

@ -127,7 +127,7 @@ RSpec.describe NotifyService, type: :service do
end
end
context do
context 'with muted and blocked users' do
let(:asshole) { Fabricate(:account, username: 'asshole') }
let(:reply_to) { Fabricate(:status, account: asshole) }
let(:activity) { Fabricate(:mention, account: recipient, status: Fabricate(:status, account: sender, thread: reply_to)) }
@ -144,7 +144,7 @@ RSpec.describe NotifyService, type: :service do
end
end
context do
context 'with sender as recipient' do
let(:sender) { recipient }
it 'does not notify when recipient is the sender' do

View file

@ -37,7 +37,7 @@ RSpec.describe ProcessMentionsService, type: :service do
let(:status) { Fabricate(:status, account: account, text: "Hello @#{remote_user.acct}", visibility: :public) }
context 'with ActivityPub' do
context do
context 'with a valid remote user' do
let!(:remote_user) { Fabricate(:account, username: 'remote_user', protocol: :activitypub, domain: 'example.com', inbox_url: 'http://example.com/inbox') }
before do