Skip to content

Commit

Permalink
Fix the redirect routing (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbcr authored May 7, 2021
1 parent e740838 commit 6e36bc0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Resources/config/routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sylius_sitemap_index:
sylius_sitemap_no_index:
path: /sitemap.xml
defaults:
_controller: FrameworkBundle:Redirect:redirect
_controller: 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController:redirectAction'
route: sylius_sitemap_index
permanent: true

Expand Down
7 changes: 7 additions & 0 deletions tests/Controller/SitemapIndexControllerApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ public function setUpDatabase(): void
$this->generateSitemaps();
}

public function testRedirectActionResponse()
{
$response = $this->getBufferedResponse('/sitemap.xml');

$this->assertResponseRedirects('http://localhost/sitemap_index.xml', 301);
}

public function testShowActionResponse()
{
$response = $this->getBufferedResponse('/sitemap_index.xml');
Expand Down

0 comments on commit 6e36bc0

Please sign in to comment.