Skip to content

Commit

Permalink
Add redirect fields to entry blueprint in test
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean committed Feb 13, 2024
1 parent e38eedb commit 4b0930c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/FrontendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,24 @@ public function redirect_http_status_is_applied_when_present_in_blueprint()
],
]))->save();

Blueprint::shouldReceive('find')
->with('collections/pages/page')
->andReturn($entry->blueprint()->setContents([
'fields' => [
['handle' => 'title', 'field' => ['type' => 'text']],
[
'handle' => 'redirect',
'field' => [
'type' => 'group', 'required' => true, 'width' => '100',
'fields' => [
['handle' => 'url', 'field' => ['type' => 'link']],
['handle' => 'status', 'field' => ['type' => 'radio', 'options' => [301 => __('301 (Permanent)'), 302 => __('302 (Temporary)')]]],
],
],
],
],
]));

$response = $this->get('/about');

$response->assertRedirect('/test');
Expand Down

0 comments on commit 4b0930c

Please sign in to comment.