(cookies, shouldContainXC101, callback)
| 99 | /**********************************************************************/ |
| 100 | |
| 101 | var getPl = function(cookies, shouldContainXC101, callback) { |
| 102 | request({url: siteUrl, jar: cookies}, function (error, response, body) { |
| 103 | if (error) { |
| 104 | return callback(error); |
| 105 | } |
| 106 | if (response.statusCode != 200) { |
| 107 | return callback(new Error('bad status: ' + response.statusCode)); |
| 108 | } |
| 109 | page = body; |
| 110 | try { |
| 111 | $ = cheerio.load(page); |
| 112 | elemList = $('#content td a:contains("XC 101")'); |
| 113 | assert.lengthOf(elemList, shouldContainXC101 ? 1 : 0); |
| 114 | } catch (err) { |
| 115 | return callback(err); |
| 116 | } |
| 117 | callback(null); |
| 118 | }); |
| 119 | }; |
| 120 | |
| 121 | describe('1. GET /pl', function() { |
| 122 | it('as student should not contain XC 101', function(callback) { |
no test coverage detected