|
1 | 1 | 'use strict'; |
2 | 2 |
|
| 3 | +var moment = require('moment'); |
3 | 4 | var should = require('chai').should(); // eslint-disable-line |
4 | 5 |
|
5 | 6 | describe('open_graph', function() { |
@@ -371,4 +372,35 @@ describe('open_graph', function() { |
371 | 372 |
|
372 | 373 | result.should.contain(meta({property: 'fb:app_id', content: '123456789'})); |
373 | 374 | }); |
| 375 | + |
| 376 | + it('updated - options', function() { |
| 377 | + var result = openGraph.call({ |
| 378 | + page: { updated: moment('2016-05-23T21:20:21.372Z') }, |
| 379 | + config: {}, |
| 380 | + is_post: isPost |
| 381 | + }, { }); |
| 382 | + |
| 383 | + result.should.contain(meta({property: 'og:updated_time', content: '2016-05-23T21:20:21.372Z'})); |
| 384 | + }); |
| 385 | + |
| 386 | + it('updated - options - allow overriding og:updated_time', function() { |
| 387 | + var result = openGraph.call({ |
| 388 | + page: { updated: moment('2016-05-23T21:20:21.372Z') }, |
| 389 | + config: {}, |
| 390 | + is_post: isPost |
| 391 | + }, { updated: moment('2015-04-22T20:19:20.371Z') }); |
| 392 | + |
| 393 | + result.should.contain(meta({property: 'og:updated_time', content: '2015-04-22T20:19:20.371Z'})); |
| 394 | + }); |
| 395 | + |
| 396 | + it('updated - options - allow disabling og:updated_time', function() { |
| 397 | + var result = openGraph.call({ |
| 398 | + page: { updated: moment('2016-05-23T21:20:21.372Z') }, |
| 399 | + config: {}, |
| 400 | + is_post: isPost |
| 401 | + }, { updated: false }); |
| 402 | + |
| 403 | + result.should.not.contain(meta({property: 'og:updated_time', content: '2016-05-23T21:20:21.372Z'})); |
| 404 | + }); |
| 405 | + |
374 | 406 | }); |
0 commit comments