mirror of
https://github.com/archtechx/laravel-seo.git
synced 2025-12-12 09:54:03 +00:00
OpenGraph improvements (#17)
* Allow setting tag('og:title', ...)
* og:type overriding
* Add type()
This commit is contained in:
parent
2480e532bf
commit
754b3936d0
4 changed files with 50 additions and 5 deletions
|
|
@ -127,3 +127,22 @@ test('canonical url can be changed', function () {
|
|||
->toContain('<meta property="og:url" content="http://foo.com/bar" />')
|
||||
->toContain('<link rel="canonical" href="http://foo.com/bar" />');
|
||||
});
|
||||
|
||||
test('og:title can be overridden using a tag', function () {
|
||||
seo()->title('foo')
|
||||
->tag('og:title', 'bar');
|
||||
|
||||
expect(meta())
|
||||
->toContain('<title>foo</title>')
|
||||
->toContain('<meta property="og:title" content="bar" />');
|
||||
});
|
||||
|
||||
test('type can be overridden using the type method', function () {
|
||||
expect(meta())->toContain('<meta property="og:type" content="website" />'); // default
|
||||
|
||||
seo()->type('foo');
|
||||
|
||||
expect(meta())
|
||||
->toContain('<meta property="og:type" content="foo" />') // overridden
|
||||
->not()->toContain('website');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue