forked from danmactough/node-feedparser
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnamespacedElements-01.js
45 lines (43 loc) · 1.7 KB
/
namespacedElements-01.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
describe('feedparser', function(){
var feedparser = new FeedParser({silent: true})
, feed = __dirname + '/feeds/wapowellness.xml'
, meta = {}
, articles = {}
;
describe('namespaced elements', function(){
before(function(done){
feedparser.parseFile(feed, function (error, _meta, _articles) {
assert.ifError(error);
meta = _meta;
articles = _articles;
done();
});
});
describe('article', function(){
it('should have the expected author via dc:creator', function() {
assert.equal(articles[0].author, 'Lenny Bernstein');
});
it('should have the expected origlink via pheedo:origlink', function(){
assert.equal(articles[0].origlink, 'http://www.washingtonpost.com/lifestyle/wellness/schools-minister-to-kids-fitness-and-nutrition-needs/2012/08/21/0ca90d46-e6eb-11e1-936a-b801f1abab19_story.html?wprss=rss_wellness');
});
});
});
describe('namespaced elements using static methods', function(){
before(function(done){
FeedParser.parseFile(feed, function (error, _meta, _articles) {
assert.ifError(error);
meta = _meta;
articles = _articles;
done();
});
});
describe('article', function(){
it('should have the expected author via dc:creator', function() {
assert.equal(articles[0].author, 'Lenny Bernstein');
});
it('should have the expected origlink via pheedo:origlink', function(){
assert.equal(articles[0].origlink, 'http://www.washingtonpost.com/lifestyle/wellness/schools-minister-to-kids-fitness-and-nutrition-needs/2012/08/21/0ca90d46-e6eb-11e1-936a-b801f1abab19_story.html?wprss=rss_wellness');
});
});
});
});