@ -11,7 +11,7 @@ RSpec.describe ActivityPub::FetchRemoteStatusService, type: :service do
let ( :note ) do
let ( :note ) do
{
{
'@context' : 'https://www.w3.org/ns/activitystreams' ,
'@context' : 'https://www.w3.org/ns/activitystreams' ,
id : " https://foo.bar/@foo/1234 " ,
id : 'https://foo.bar/@foo/1234' ,
type : 'Note' ,
type : 'Note' ,
content : 'Lorem ipsum' ,
content : 'Lorem ipsum' ,
attributedTo : ActivityPub :: TagManager . instance . uri_for ( sender ) ,
attributedTo : ActivityPub :: TagManager . instance . uri_for ( sender ) ,
@ -46,7 +46,7 @@ RSpec.describe ActivityPub::FetchRemoteStatusService, type: :service do
let ( :object ) do
let ( :object ) do
{
{
'@context' : 'https://www.w3.org/ns/activitystreams' ,
'@context' : 'https://www.w3.org/ns/activitystreams' ,
id : " https://foo.bar/@foo/1234 " ,
id : 'https://foo.bar/@foo/1234' ,
type : 'Video' ,
type : 'Video' ,
name : 'Nyan Cat 10 hours remix' ,
name : 'Nyan Cat 10 hours remix' ,
attributedTo : ActivityPub :: TagManager . instance . uri_for ( sender ) ,
attributedTo : ActivityPub :: TagManager . instance . uri_for ( sender ) ,
@ -54,13 +54,13 @@ RSpec.describe ActivityPub::FetchRemoteStatusService, type: :service do
{
{
type : 'Link' ,
type : 'Link' ,
mimeType : 'application/x-bittorrent' ,
mimeType : 'application/x-bittorrent' ,
href : " https://foo.bar/12345.torrent " ,
href : 'https://foo.bar/12345.torrent' ,
} ,
} ,
{
{
type : 'Link' ,
type : 'Link' ,
mimeType : 'text/html' ,
mimeType : 'text/html' ,
href : " https://foo.bar/watch?v=12345 " ,
href : 'https://foo.bar/watch?v=12345' ,
} ,
} ,
] ,
] ,
}
}
@ -70,8 +70,8 @@ RSpec.describe ActivityPub::FetchRemoteStatusService, type: :service do
status = sender . statuses . first
status = sender . statuses . first
expect ( status ) . to_not be_nil
expect ( status ) . to_not be_nil
expect ( status . url ) . to eq " https://foo.bar/watch?v=12345 "
expect ( status . url ) . to eq 'https://foo.bar/watch?v=12345'
expect ( strip_tags ( status . text ) ) . to eq " Nyan Cat 10 hours remixhttps://foo.bar/watch?v=12345 "
expect ( strip_tags ( status . text ) ) . to eq 'Nyan Cat 10 hours remixhttps://foo.bar/watch?v=12345'
end
end
end
end
@ -79,7 +79,7 @@ RSpec.describe ActivityPub::FetchRemoteStatusService, type: :service do
let ( :object ) do
let ( :object ) do
{
{
'@context' : 'https://www.w3.org/ns/activitystreams' ,
'@context' : 'https://www.w3.org/ns/activitystreams' ,
id : " https://foo.bar/@foo/1234 " ,
id : 'https://foo.bar/@foo/1234' ,
type : 'Audio' ,
type : 'Audio' ,
name : 'Nyan Cat 10 hours remix' ,
name : 'Nyan Cat 10 hours remix' ,
attributedTo : ActivityPub :: TagManager . instance . uri_for ( sender ) ,
attributedTo : ActivityPub :: TagManager . instance . uri_for ( sender ) ,
@ -87,13 +87,13 @@ RSpec.describe ActivityPub::FetchRemoteStatusService, type: :service do
{
{
type : 'Link' ,
type : 'Link' ,
mimeType : 'application/x-bittorrent' ,
mimeType : 'application/x-bittorrent' ,
href : " https://foo.bar/12345.torrent " ,
href : 'https://foo.bar/12345.torrent' ,
} ,
} ,
{
{
type : 'Link' ,
type : 'Link' ,
mimeType : 'text/html' ,
mimeType : 'text/html' ,
href : " https://foo.bar/watch?v=12345 " ,
href : 'https://foo.bar/watch?v=12345' ,
} ,
} ,
] ,
] ,
}
}
@ -103,8 +103,8 @@ RSpec.describe ActivityPub::FetchRemoteStatusService, type: :service do
status = sender . statuses . first
status = sender . statuses . first
expect ( status ) . to_not be_nil
expect ( status ) . to_not be_nil
expect ( status . url ) . to eq " https://foo.bar/watch?v=12345 "
expect ( status . url ) . to eq 'https://foo.bar/watch?v=12345'
expect ( strip_tags ( status . text ) ) . to eq " Nyan Cat 10 hours remixhttps://foo.bar/watch?v=12345 "
expect ( strip_tags ( status . text ) ) . to eq 'Nyan Cat 10 hours remixhttps://foo.bar/watch?v=12345'
end
end
end
end
@ -112,7 +112,7 @@ RSpec.describe ActivityPub::FetchRemoteStatusService, type: :service do
let ( :object ) do
let ( :object ) do
{
{
'@context' : 'https://www.w3.org/ns/activitystreams' ,
'@context' : 'https://www.w3.org/ns/activitystreams' ,
id : " https://foo.bar/@foo/1234 " ,
id : 'https://foo.bar/@foo/1234' ,
type : 'Event' ,
type : 'Event' ,
name : " Let's change the world " ,
name : " Let's change the world " ,
attributedTo : ActivityPub :: TagManager . instance . uri_for ( sender ) ,
attributedTo : ActivityPub :: TagManager . instance . uri_for ( sender ) ,
@ -123,7 +123,7 @@ RSpec.describe ActivityPub::FetchRemoteStatusService, type: :service do
status = sender . statuses . first
status = sender . statuses . first
expect ( status ) . to_not be_nil
expect ( status ) . to_not be_nil
expect ( status . url ) . to eq " https://foo.bar/@foo/1234 "
expect ( status . url ) . to eq 'https://foo.bar/@foo/1234'
expect ( strip_tags ( status . text ) ) . to eq " Let's change the worldhttps://foo.bar/@foo/1234 "
expect ( strip_tags ( status . text ) ) . to eq " Let's change the worldhttps://foo.bar/@foo/1234 "
end
end
end
end
@ -132,7 +132,7 @@ RSpec.describe ActivityPub::FetchRemoteStatusService, type: :service do
let ( :note ) do
let ( :note ) do
{
{
'@context' : 'https://www.w3.org/ns/activitystreams' ,
'@context' : 'https://www.w3.org/ns/activitystreams' ,
id : " https://real.address/@foo/1234 " ,
id : 'https://real.address/@foo/1234' ,
type : 'Note' ,
type : 'Note' ,
content : 'Lorem ipsum' ,
content : 'Lorem ipsum' ,
attributedTo : ActivityPub :: TagManager . instance . uri_for ( sender ) ,
attributedTo : ActivityPub :: TagManager . instance . uri_for ( sender ) ,
@ -154,7 +154,7 @@ RSpec.describe ActivityPub::FetchRemoteStatusService, type: :service do
let ( :object ) do
let ( :object ) do
{
{
'@context' : 'https://www.w3.org/ns/activitystreams' ,
'@context' : 'https://www.w3.org/ns/activitystreams' ,
id : " https://foo.bar/@foo/1234/create " ,
id : 'https://foo.bar/@foo/1234/create' ,
type : 'Create' ,
type : 'Create' ,
actor : ActivityPub :: TagManager . instance . uri_for ( sender ) ,
actor : ActivityPub :: TagManager . instance . uri_for ( sender ) ,
object : note ,
object : note ,
@ -174,11 +174,11 @@ RSpec.describe ActivityPub::FetchRemoteStatusService, type: :service do
let ( :object ) do
let ( :object ) do
{
{
'@context' : 'https://www.w3.org/ns/activitystreams' ,
'@context' : 'https://www.w3.org/ns/activitystreams' ,
id : " https://foo.bar/@foo/1234/create " ,
id : 'https://foo.bar/@foo/1234/create' ,
type : 'Create' ,
type : 'Create' ,
actor : ActivityPub :: TagManager . instance . uri_for ( sender ) ,
actor : ActivityPub :: TagManager . instance . uri_for ( sender ) ,
object : {
object : {
id : " https://real.address/@foo/1234 " ,
id : 'https://real.address/@foo/1234' ,
type : 'Note' ,
type : 'Note' ,
content : 'Lorem ipsum' ,
content : 'Lorem ipsum' ,
attributedTo : ActivityPub :: TagManager . instance . uri_for ( sender ) ,
attributedTo : ActivityPub :: TagManager . instance . uri_for ( sender ) ,
@ -208,7 +208,7 @@ RSpec.describe ActivityPub::FetchRemoteStatusService, type: :service do
let ( :object ) do
let ( :object ) do
{
{
'@context' : 'https://www.w3.org/ns/activitystreams' ,
'@context' : 'https://www.w3.org/ns/activitystreams' ,
id : " https://foo.bar/@foo/1234/create " ,
id : 'https://foo.bar/@foo/1234/create' ,
type : 'Create' ,
type : 'Create' ,
actor : ActivityPub :: TagManager . instance . uri_for ( sender ) ,
actor : ActivityPub :: TagManager . instance . uri_for ( sender ) ,
object : note . merge ( updated : '2021-09-08T22:39:25Z' ) ,
object : note . merge ( updated : '2021-09-08T22:39:25Z' ) ,
@ -233,7 +233,7 @@ RSpec.describe ActivityPub::FetchRemoteStatusService, type: :service do
let ( :object ) do
let ( :object ) do
{
{
'@context' : 'https://www.w3.org/ns/activitystreams' ,
'@context' : 'https://www.w3.org/ns/activitystreams' ,
id : " https://foo.bar/@foo/1 " ,
id : 'https://foo.bar/@foo/1' ,
type : 'Note' ,
type : 'Note' ,
content : 'Lorem ipsum' ,
content : 'Lorem ipsum' ,
inReplyTo : 'https://foo.bar/@foo/2' ,
inReplyTo : 'https://foo.bar/@foo/2' ,
@ -269,7 +269,7 @@ RSpec.describe ActivityPub::FetchRemoteStatusService, type: :service do
let ( :object ) do
let ( :object ) do
{
{
'@context' : 'https://www.w3.org/ns/activitystreams' ,
'@context' : 'https://www.w3.org/ns/activitystreams' ,
id : " https://foo.bar/@foo/1 " ,
id : 'https://foo.bar/@foo/1' ,
type : 'Note' ,
type : 'Note' ,
content : 'Lorem ipsum' ,
content : 'Lorem ipsum' ,
replies : {
replies : {