1
0
Fork 0
mirror of https://github.com/archtechx/laravel-seo.git synced 2025-12-12 09:54:03 +00:00

Canonical URLs, fix #1

This commit is contained in:
Samuel Štancl 2021-05-26 13:18:13 +02:00
parent 6df030c28d
commit db7269ff28
4 changed files with 67 additions and 10 deletions

View file

@ -94,3 +94,27 @@ test('raw tags can be added to the template', function () {
expect(meta())->toContain('<meta foo bar>');
});
test('canonical url is not included by default', function () {
expect(meta())
->not()->toContain('og:url')
->not()->toContain('canonical');
});
test('canonical url can be read from request', function () {
seo()->withUrl();
expect(meta())
->toContain('<meta property="og:url" content="http://localhost" />')
->toContain('<link rel="canonical" href="http://localhost" />');
});
test('canonical url can be changed', function () {
seo()->withUrl();
seo()->url('http://foo.com/bar');
expect(meta())
->toContain('<meta property="og:url" content="http://foo.com/bar" />')
->toContain('<link rel="canonical" href="http://foo.com/bar" />');
});