Sha256: 5982c7ef24bd1b4ce750e5ac55782a6d5ceb31703ff61329e87a534a70e6f715

Contents?: true

Size: 1.78 KB

Versions: 62

Compression:

Stored size: 1.78 KB

Contents

/*
 * Copyright 2012 Cloud9 IDE, Inc.
 *
 * This product includes software developed by
 * Cloud9 IDE, Inc (http://c9.io).
 *
 * Author: Mike de Boer <mike@c9.io>
 */

"use strict";

var Assert = require("assert");
var Client = require("./../index");

describe("[client]", function() {
    var client;
    var token = "e5a4a27487c26e571892846366de023349321a73";

    beforeEach(function() {
        client = new Client({
            version: "3.0.0"
        });
        /*client.authenticate({
            type: "oauth",
            token: token
        });*/
    });

    it("should successfully execute GET /authorizations (getAll)",  function(next) {
        // `aseemk` has two pages of followers right now.
        client.user.getFollowers(
            {
                user: "aseemk"
            },
            function(err, res) {
                Assert.equal(err, null);

                Assert.ok(!!client.hasNextPage(res));
                Assert.ok(!!client.hasLastPage(res));
                Assert.ok(!client.hasPreviousPage(res));

                client.getNextPage(res, function(err, res) {
                    Assert.equal(err, null);

                    Assert.ok(!!client.hasPreviousPage(res));
                    Assert.ok(!!client.hasFirstPage(res));
                    Assert.ok(!client.hasNextPage(res));
                    Assert.ok(!client.hasLastPage(res));

                    client.getPreviousPage(res.meta.link, function(err, res) {
                        Assert.equal(err, null);

                        Assert.ok(!!client.hasNextPage(res));
                        Assert.ok(!!client.hasLastPage(res));
                        Assert.ok(!client.hasPreviousPage(res));
                        next();
                    });
                });
            }
        );
    });
});

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
trusty-festivity-extension-2.5.3 node_modules/bower/node_modules/github/test/client_test.js
trusty-festivity-extension-2.5.2 node_modules/bower/node_modules/github/test/client_test.js
trusty-festivity-extension-2.5.1 node_modules/bower/node_modules/github/test/client_test.js
trusty-festivity-extension-2.5.0 node_modules/bower/node_modules/github/test/client_test.js
trusty-festivity-extension-2.4.6 node_modules/bower/node_modules/github/test/client_test.js
trusty-festivity-extension-2.4.5 node_modules/bower/node_modules/github/test/client_test.js
trusty-festivity-extension-2.4.4 node_modules/bower/node_modules/github/test/client_test.js
trusty-festivity-extension-2.4.3 node_modules/bower/node_modules/github/test/client_test.js
trusty-festivity-extension-2.4.2 node_modules/bower/node_modules/github/test/client_test.js
trusty-festivity-extension-2.4.1 node_modules/bower/node_modules/github/test/client_test.js
trusty-festivity-extension-2.4.0 node_modules/bower/node_modules/github/test/client_test.js
trusty-festivity-extension-2.3.30 node_modules/bower/node_modules/github/test/client_test.js
trusty-festivity-extension-2.3.29 node_modules/bower/node_modules/github/test/client_test.js
trusty-festivity-extension-2.3.28 node_modules/bower/node_modules/github/test/client_test.js
trusty-festivity-extension-2.3.27 node_modules/bower/node_modules/github/test/client_test.js
trusty-festivity-extension-2.3.26 node_modules/bower/node_modules/github/test/client_test.js
trusty-festivity-extension-2.3.25 node_modules/bower/node_modules/github/test/client_test.js
trusty-festivity-extension-2.3.24 node_modules/bower/node_modules/github/test/client_test.js
trusty-festivity-extension-2.3.23 node_modules/bower/node_modules/github/test/client_test.js
trusty-festivity-extension-2.3.22 node_modules/bower/node_modules/github/test/client_test.js