Run rubocop formatting except line length (#23632)
This commit is contained in:
parent
593bb8ce99
commit
669f6d2c0a
71 changed files with 269 additions and 566 deletions
|
@ -408,7 +408,6 @@ RSpec.describe ActivityPub::Activity::Create do
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
context 'with media attachments with long description' do
|
||||
let(:object_json) do
|
||||
{
|
||||
|
|
|
@ -20,7 +20,7 @@ describe Extractor do
|
|||
text = '@screen_name'
|
||||
extracted = Extractor.extract_mentions_or_lists_with_indices(text)
|
||||
expect(extracted).to eq [
|
||||
{ screen_name: 'screen_name', indices: [ 0, 12 ] }
|
||||
{ screen_name: 'screen_name', indices: [0, 12] }
|
||||
]
|
||||
end
|
||||
|
||||
|
@ -44,19 +44,19 @@ describe Extractor do
|
|||
it 'does not exclude normal hash text before ://' do
|
||||
text = '#hashtag://'
|
||||
extracted = Extractor.extract_hashtags_with_indices(text)
|
||||
expect(extracted).to eq [ { hashtag: 'hashtag', indices: [ 0, 8 ] } ]
|
||||
expect(extracted).to eq [{ hashtag: 'hashtag', indices: [0, 8] }]
|
||||
end
|
||||
|
||||
it 'excludes http://' do
|
||||
text = '#hashtaghttp://'
|
||||
extracted = Extractor.extract_hashtags_with_indices(text)
|
||||
expect(extracted).to eq [ { hashtag: 'hashtag', indices: [ 0, 8 ] } ]
|
||||
expect(extracted).to eq [{ hashtag: 'hashtag', indices: [0, 8] }]
|
||||
end
|
||||
|
||||
it 'excludes https://' do
|
||||
text = '#hashtaghttps://'
|
||||
extracted = Extractor.extract_hashtags_with_indices(text)
|
||||
expect(extracted).to eq [ { hashtag: 'hashtag', indices: [ 0, 8 ] } ]
|
||||
expect(extracted).to eq [{ hashtag: 'hashtag', indices: [0, 8] }]
|
||||
end
|
||||
|
||||
it 'yields hashtags if a block is given' do
|
||||
|
|
|
@ -4,7 +4,7 @@ require 'rails_helper'
|
|||
|
||||
describe FastIpMap do
|
||||
describe '#include?' do
|
||||
subject { described_class.new([IPAddr.new('20.4.0.0/16'), IPAddr.new('145.22.30.0/24'), IPAddr.new('189.45.86.3')])}
|
||||
subject { described_class.new([IPAddr.new('20.4.0.0/16'), IPAddr.new('145.22.30.0/24'), IPAddr.new('189.45.86.3')]) }
|
||||
|
||||
it 'returns true for an exact match' do
|
||||
expect(subject.include?(IPAddr.new('189.45.86.3'))).to be true
|
||||
|
|
|
@ -39,17 +39,17 @@ RSpec.describe LinkDetailsExtractor do
|
|||
let(:original_url) { 'https://example.com/page.html' }
|
||||
|
||||
context 'and is wrapped in CDATA tags' do
|
||||
let(:html) { <<-HTML }
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<script type="application/ld+json">
|
||||
//<![CDATA[
|
||||
{"@context":"http://schema.org","@type":"NewsArticle","mainEntityOfPage":"https://example.com/page.html","headline":"Foo","datePublished":"2022-01-31T19:53:00+00:00","url":"https://example.com/page.html","description":"Bar","author":{"@type":"Person","name":"Hoge"},"publisher":{"@type":"Organization","name":"Baz"}}
|
||||
//]]>
|
||||
</script>
|
||||
</head>
|
||||
</html>
|
||||
let(:html) { <<~HTML }
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<script type="application/ld+json">
|
||||
//<![CDATA[
|
||||
{"@context":"http://schema.org","@type":"NewsArticle","mainEntityOfPage":"https://example.com/page.html","headline":"Foo","datePublished":"2022-01-31T19:53:00+00:00","url":"https://example.com/page.html","description":"Bar","author":{"@type":"Person","name":"Hoge"},"publisher":{"@type":"Organization","name":"Baz"}}
|
||||
//]]>
|
||||
</script>
|
||||
</head>
|
||||
</html>
|
||||
HTML
|
||||
|
||||
describe '#title' do
|
||||
|
@ -78,57 +78,57 @@ RSpec.describe LinkDetailsExtractor do
|
|||
end
|
||||
|
||||
context 'but the first tag is invalid JSON' do
|
||||
let(:html) { <<-HTML }
|
||||
<!doctype html>
|
||||
<html>
|
||||
<body>
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context":"https://schema.org",
|
||||
"@type":"ItemList",
|
||||
"url":"https://example.com/page.html",
|
||||
"name":"Foo",
|
||||
"description":"Bar"
|
||||
},
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "BreadcrumbList",
|
||||
"itemListElement":[
|
||||
{
|
||||
"@type":"ListItem",
|
||||
"position":1,
|
||||
"item":{
|
||||
"@id":"https://www.example.com",
|
||||
"name":"Baz"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
</script>
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context":"https://schema.org",
|
||||
"@type":"NewsArticle",
|
||||
"mainEntityOfPage": {
|
||||
"@type":"WebPage",
|
||||
"@id": "http://example.com/page.html"
|
||||
},
|
||||
"headline": "Foo",
|
||||
"description": "Bar",
|
||||
"datePublished": "2022-01-31T19:46:00+00:00",
|
||||
"author": {
|
||||
"@type": "Organization",
|
||||
"name": "Hoge"
|
||||
},
|
||||
"publisher": {
|
||||
"@type": "NewsMediaOrganization",
|
||||
"name":"Baz",
|
||||
"url":"https://example.com/"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
let(:html) { <<~HTML }
|
||||
<!doctype html>
|
||||
<html>
|
||||
<body>
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context":"https://schema.org",
|
||||
"@type":"ItemList",
|
||||
"url":"https://example.com/page.html",
|
||||
"name":"Foo",
|
||||
"description":"Bar"
|
||||
},
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "BreadcrumbList",
|
||||
"itemListElement":[
|
||||
{
|
||||
"@type":"ListItem",
|
||||
"position":1,
|
||||
"item":{
|
||||
"@id":"https://www.example.com",
|
||||
"name":"Baz"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
</script>
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context":"https://schema.org",
|
||||
"@type":"NewsArticle",
|
||||
"mainEntityOfPage": {
|
||||
"@type":"WebPage",
|
||||
"@id": "http://example.com/page.html"
|
||||
},
|
||||
"headline": "Foo",
|
||||
"description": "Bar",
|
||||
"datePublished": "2022-01-31T19:46:00+00:00",
|
||||
"author": {
|
||||
"@type": "Organization",
|
||||
"name": "Hoge"
|
||||
},
|
||||
"publisher": {
|
||||
"@type": "NewsMediaOrganization",
|
||||
"name":"Baz",
|
||||
"url":"https://example.com/"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
HTML
|
||||
|
||||
describe '#title' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue