Skip to content

Commit

Permalink
test(open_graph): avoid double-escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
curbengh committed Oct 7, 2019
1 parent 8bd3439 commit e6ed3f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/scripts/helpers/open_graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ describe('open_graph', () => {
const isPost = require('../../../lib/plugins/helper/is').post;
const tag = require('hexo-util').htmlTag;
const Post = hexo.model('Post');
const cheerio = require('cheerio');

function meta(options) {
return tag('meta', options);
Expand Down Expand Up @@ -591,7 +592,8 @@ describe('open_graph', () => {
const result = openGraph.call(ctx);
const keywords = 'optimize,web&<>"'/,site';

result.should.contain(meta({name: 'keywords', content: keywords}));
const $ = cheerio.load(result, { decodeEntities: false });
$('meta[name="keywords"]').attr('content').should.eql(keywords);
});

it('og:locale - options.language', () => {
Expand Down

0 comments on commit e6ed3f8

Please sign in to comment.