Add AS2.0 data for a note
This commit is contained in:
parent
d33793df14
commit
f3cfa9324c
2 changed files with 52 additions and 0 deletions
|
@ -23,4 +23,28 @@ class ActivityStreamTest extends TestCase
|
|||
'name' => config('app.display_name'),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test request to a single note returns AS2.0 data.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function test_single_note_returns_as_data()
|
||||
{
|
||||
$note = \App\Note::find(11);
|
||||
$response = $this->get('/notes/B', ['Accept' => 'application/activity+json']);
|
||||
$response->assertHeader('Content-Type', 'application/activity+json');
|
||||
$response->assertJson([
|
||||
'@context' => 'https://www.w3.org/ns/activitystreams',
|
||||
'type' => 'Add',
|
||||
'actor' => [
|
||||
'type' => 'Person',
|
||||
'id' => config('app.url'),
|
||||
],
|
||||
'object' => [
|
||||
'type' => 'Note',
|
||||
'name' => strip_tags($note->note)
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue