commit ddd1455aabb857fdc139f992ba85f834dc110633
parent 0f45569ccd9a3f4589bc1bb658c16701b7886f7b
Author: Adomas Ven <adomas.ven@gmail.com>
Date: Thu, 12 May 2016 21:46:30 +0100
Stub out feed updates for importFromOPML() tests
No need to do network requests
Diffstat:
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/test/tests/feedsTest.js b/test/tests/feedsTest.js
@@ -9,20 +9,26 @@ describe("Zotero.Feeds", function () {
var opmlString;
before(function* (){
- opmlString = yield Zotero.File.getContentsFromURLAsync(opmlUrl)
+ opmlString = yield Zotero.File.getContentsFromURLAsync(opmlUrl);
+ sinon.stub(Zotero.Feeds, 'updateFeeds').resolves();
});
beforeEach(function* () {
yield clearFeeds();
});
+ after(function() {
+ Zotero.Feeds.updateFeeds.restore();
+ });
+
it('imports feeds correctly', function* (){
let shouldExist = {
"http://example.com/feed1.rss": "A title 1",
"http://example.com/feed2.rss": "A title 2",
"http://example.com/feed3.rss": "A title 3",
"http://example.com/feed4.rss": "A title 4"
- }; yield Zotero.Feeds.importFromOPML(opmlString);
+ };
+ yield Zotero.Feeds.importFromOPML(opmlString);
let feeds = Zotero.Feeds.getAll();
for (let feed of feeds) {
assert.equal(shouldExist[feed.url], feed.name, "Feed exists and title matches");