diff --git a/common.blocks/app/controllers/Poems.js b/common.blocks/app/controllers/Poems.js index 3c2bb52..b126df8 100644 --- a/common.blocks/app/controllers/Poems.js +++ b/common.blocks/app/controllers/Poems.js @@ -80,6 +80,7 @@ Poems._getLinesFromPoem = function(poemText) { * Получить стихотворение из БД по id * * @param pModel + * @param authorModel * @param poemId * @returns {*} */ diff --git a/common.blocks/i-jquery/__ui/i-jquery__ui.js b/common.blocks/i-jquery/__ui/i-jquery__ui.js index ad4573f..ec85352 100644 --- a/common.blocks/i-jquery/__ui/i-jquery__ui.js +++ b/common.blocks/i-jquery/__ui/i-jquery__ui.js @@ -108,7 +108,7 @@ "a" === nodeName ? element.href || isTabIndexNotNaN : isTabIndexNotNaN) && - // the element and all of its ancestors must be visible + // the element and all of its ancestors must be visible visible( element ); } @@ -2160,4 +2160,4 @@ -})); +})); \ No newline at end of file diff --git a/test/unit/controllers/Authors.js b/test/unit/controllers/Authors.js index ebb642d..e969af8 100644 --- a/test/unit/controllers/Authors.js +++ b/test/unit/controllers/Authors.js @@ -116,6 +116,7 @@ models(function (err, db) { }); + }); }); diff --git a/test/unit/controllers/Poems.js b/test/unit/controllers/Poems.js index 4d6c4fd..c5b9dfb 100644 --- a/test/unit/controllers/Poems.js +++ b/test/unit/controllers/Poems.js @@ -75,6 +75,28 @@ models(function (err, db) { }); + it('should find poem by _id', function () { + var deferred = vow.defer(), + uId = 'b12345678902'; + + Authors.create(aModel, 'a12345678901', uId).then(a => { + Poems.create(pModel, 'name', a._id, uId, 'текст стихотворения\n
состоящий из нескольких строк ;":№%') + .then(function (data) { + Poems.getById(pModel, aModel, data._id) + .then(function (poem) { + deferred.resolve(poem.poem); + }, function (e) { + deferred.reject('Could not retrieve Poem from db (by id)'); + }); + }); + }); + + return assert.eventually.ok( + deferred.promise(), + 'Should be not empty' + ); + }); + }); });