{"action":"created","comment":{"url":"https://api.github.com/repos/RIKSOF/json-api-vc/pulls/comments/90811714","pull_request_review_id":11326457,"id":90811714,"diff_hunk":"@@ -0,0 +1,136 @@\n+'use strict';\n+\n+/**\n+ * @author Copyright RIKSOF (Private) Limited 2016.\n+ *\n+ * @file Test branches.\n+ */\n+var assert = require('assert');\n+var lokijs = require('lokijs');\n+var Branches = require('../../lib/vc/Branches.js');\n+var Mongo = require('../../lib/db/MongoDb.js');\n+var Promise = require( 'bluebird' );\n+var db;\n+\n+describe( 'Branches Model MongoDb', function branchesModel() {\n+  \n+  before( function (done) {\n+\n+    db = new Mongo ( 'mongodb://localhost:27017/versioncontrol' );\n+    db.connect().then( function( connection ) { \n+      done();\n+    });\n+\n+  });\n+\n+  it( 'should return null on checkout of unknown branch', function() {\n+\n+    var bs = new Branches( 'RIKSOF', db );\n+    return bs.setup().then( function () {\n+      return bs.checkout('unknown');\n+    }).then( function( current ) {\n+      assert.equal( null, current );\n+    });\n+  \n+  });\n+\n+  it( 'Should add a new branch.', function() {\n+\n+    var bs = new Branches( 'RIKSOF', db );\n+\n+    return bs.setup().then( function ( branch ) {\n+      // Branch can be added.\n+      return bs.add('branch');\n+    }).then( function ( current ) {\n+      assert.notEqual( null, current );\n+      // We can checkout the new branch.\n+      return bs.checkout('branch');\n+    }).then( function( current ) {\n+      assert.notEqual( null, current );\n+    });\n+  });\n+\n+  it( 'Should delete a branch', function() {\n+    \n+    var bs = new Branches( 'RIKSOF', db );\n+    return bs.setup().then( function () {\n+      // Branch can be added.\n+      return bs.add('branch');\n+    }).then( function ( current ) {\n+      assert.notEqual( null, current );\n+\n+      // Now delete the branch\n+      return bs.delete('branch');\n+    }).then( function ( current ) {\n+      // Can we checkout the deleted branch?\n+      return bs.checkout('branch');\n+    }).then( function( current ) {\n+      assert.equal( null, current );\n+\n+      // Delete unknown branch. Nothing happens.\n+      return bs.delete('unknown');\n+    }).then( function ( current ) {\n+      // Can we checkout the deleted branch?\n+      return bs.checkout('unknown');\n+    }).then( function( current ) {\n+      assert.equal( null, current );\n+    });\n+  });\n+\n+  it( 'Should correctly return list of branches', function() {\n+    var bs = new Branches( 'RIKSOF', db );\n+\n+    return bs.setup().then( function () {\n+      // Branches are added.\n+      return bs.add('a');\n+    }).then( function () {\n+      return bs.add('b');\n+    }).then( function () {\n+      return bs.add('c');\n+    }).then( function () {\n+      return bs.add('d');\n+    }).then( function () {\n+      return bs.add('e');\n+    }).then( function () {\n+      // Now delete a branch\n+      return bs.delete('d');\n+    }).then( function () {\n+      // Then add another one.\n+      return bs.add('f');\n+    }).then( function () {\n+      return bs.list();\n+    }).then( function ( list ) {\n+      assert.deepEqual( [ 'a', 'b', 'c', 'e', 'f'], list );\n+    });\n+  });\n+   it( 'Should get branches information', function() {\n+\n+    var bs = new Branches( 'RIKSOF', db );\n+\n+    return bs.setup().then( function () {\n+      // Branches are added.\n+      return bs.add('a');\n+    }).then( function () {\n+      return bs.add('b');\n+    }).then( function () {\n+      return bs.add('c');\n+    }).then( function () {\n+      return bs.add('d');\n+    }).then( function () {","path":"test/vc/Branches.mongodb.js","position":92,"original_position":119,"commit_id":"2cc2ee57144a25922817db144fefde9ee9b11711","original_commit_id":"2cc2ee57144a25922817db144fefde9ee9b11711","user":{"login":"mkhurramali","id":1565155,"avatar_url":"https://avatars.githubusercontent.com/u/1565155?v=3","gravatar_id":"","url":"https://api.github.com/users/mkhurramali","html_url":"https://github.com/mkhurramali","followers_url":"https://api.github.com/users/mkhurramali/followers","following_url":"https://api.github.com/users/mkhurramali/following{/other_user}","gists_url":"https://api.github.com/users/mkhurramali/gists{/gist_id}","starred_url":"https://api.github.com/users/mkhurramali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkhurramali/subscriptions","organizations_url":"https://api.github.com/users/mkhurramali/orgs","repos_url":"https://api.github.com/users/mkhurramali/repos","events_url":"https://api.github.com/users/mkhurramali/events{/privacy}","received_events_url":"https://api.github.com/users/mkhurramali/received_events","type":"User","site_admin":false},"body":"Missing function expression name.\n```javascript\n    }).then( function () {\n```","created_at":"2016-12-05T07:04:23Z","updated_at":"2016-12-05T07:04:23Z","html_url":"https://github.com/RIKSOF/json-api-vc/pull/3#discussion_r90811714","pull_request_url":"https://api.github.com/repos/RIKSOF/json-api-vc/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/RIKSOF/json-api-vc/pulls/comments/90811714"},"html":{"href":"https://github.com/RIKSOF/json-api-vc/pull/3#discussion_r90811714"},"pull_request":{"href":"https://api.github.com/repos/RIKSOF/json-api-vc/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/RIKSOF/json-api-vc/pulls/3","id":95444693,"html_url":"https://github.com/RIKSOF/json-api-vc/pull/3","diff_url":"https://github.com/RIKSOF/json-api-vc/pull/3.diff","patch_url":"https://github.com/RIKSOF/json-api-vc/pull/3.patch","issue_url":"https://api.github.com/repos/RIKSOF/json-api-vc/issues/3","number":3,"state":"open","locked":false,"title":"Integrate mongodb update","user":{"login":"riksof-abdulbari","id":16382695,"avatar_url":"https://avatars.githubusercontent.com/u/16382695?v=3","gravatar_id":"","url":"https://api.github.com/users/riksof-abdulbari","html_url":"https://github.com/riksof-abdulbari","followers_url":"https://api.github.com/users/riksof-abdulbari/followers","following_url":"https://api.github.com/users/riksof-abdulbari/following{/other_user}","gists_url":"https://api.github.com/users/riksof-abdulbari/gists{/gist_id}","starred_url":"https://api.github.com/users/riksof-abdulbari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/riksof-abdulbari/subscriptions","organizations_url":"https://api.github.com/users/riksof-abdulbari/orgs","repos_url":"https://api.github.com/users/riksof-abdulbari/repos","events_url":"https://api.github.com/users/riksof-abdulbari/events{/privacy}","received_events_url":"https://api.github.com/users/riksof-abdulbari/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-28T06:30:36Z","updated_at":"2016-12-05T07:04:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"da6b90b627c1e7d42b0ee959c064b3ac506429b6","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/RIKSOF/json-api-vc/pulls/3/commits","review_comments_url":"https://api.github.com/repos/RIKSOF/json-api-vc/pulls/3/comments","review_comment_url":"https://api.github.com/repos/RIKSOF/json-api-vc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RIKSOF/json-api-vc/issues/3/comments","statuses_url":"https://api.github.com/repos/RIKSOF/json-api-vc/statuses/2cc2ee57144a25922817db144fefde9ee9b11711","head":{"label":"RIKSOF:integrate-mongodb-update","ref":"integrate-mongodb-update","sha":"2cc2ee57144a25922817db144fefde9ee9b11711","user":{"login":"RIKSOF","id":1582310,"avatar_url":"https://avatars.githubusercontent.com/u/1582310?v=3","gravatar_id":"","url":"https://api.github.com/users/RIKSOF","html_url":"https://github.com/RIKSOF","followers_url":"https://api.github.com/users/RIKSOF/followers","following_url":"https://api.github.com/users/RIKSOF/following{/other_user}","gists_url":"https://api.github.com/users/RIKSOF/gists{/gist_id}","starred_url":"https://api.github.com/users/RIKSOF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RIKSOF/subscriptions","organizations_url":"https://api.github.com/users/RIKSOF/orgs","repos_url":"https://api.github.com/users/RIKSOF/repos","events_url":"https://api.github.com/users/RIKSOF/events{/privacy}","received_events_url":"https://api.github.com/users/RIKSOF/received_events","type":"Organization","site_admin":false},"repo":{"id":66145247,"name":"json-api-vc","full_name":"RIKSOF/json-api-vc","owner":{"login":"RIKSOF","id":1582310,"avatar_url":"https://avatars.githubusercontent.com/u/1582310?v=3","gravatar_id":"","url":"https://api.github.com/users/RIKSOF","html_url":"https://github.com/RIKSOF","followers_url":"https://api.github.com/users/RIKSOF/followers","following_url":"https://api.github.com/users/RIKSOF/following{/other_user}","gists_url":"https://api.github.com/users/RIKSOF/gists{/gist_id}","starred_url":"https://api.github.com/users/RIKSOF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RIKSOF/subscriptions","organizations_url":"https://api.github.com/users/RIKSOF/orgs","repos_url":"https://api.github.com/users/RIKSOF/repos","events_url":"https://api.github.com/users/RIKSOF/events{/privacy}","received_events_url":"https://api.github.com/users/RIKSOF/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RIKSOF/json-api-vc","description":"A module for quickly building json api with git like version control.","fork":false,"url":"https://api.github.com/repos/RIKSOF/json-api-vc","forks_url":"https://api.github.com/repos/RIKSOF/json-api-vc/forks","keys_url":"https://api.github.com/repos/RIKSOF/json-api-vc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RIKSOF/json-api-vc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RIKSOF/json-api-vc/teams","hooks_url":"https://api.github.com/repos/RIKSOF/json-api-vc/hooks","issue_events_url":"https://api.github.com/repos/RIKSOF/json-api-vc/issues/events{/number}","events_url":"https://api.github.com/repos/RIKSOF/json-api-vc/events","assignees_url":"https://api.github.com/repos/RIKSOF/json-api-vc/assignees{/user}","branches_url":"https://api.github.com/repos/RIKSOF/json-api-vc/branches{/branch}","tags_url":"https://api.github.com/repos/RIKSOF/json-api-vc/tags","blobs_url":"https://api.github.com/repos/RIKSOF/json-api-vc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RIKSOF/json-api-vc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RIKSOF/json-api-vc/git/refs{/sha}","trees_url":"https://api.github.com/repos/RIKSOF/json-api-vc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RIKSOF/json-api-vc/statuses/{sha}","languages_url":"https://api.github.com/repos/RIKSOF/json-api-vc/languages","stargazers_url":"https://api.github.com/repos/RIKSOF/json-api-vc/stargazers","contributors_url":"https://api.github.com/repos/RIKSOF/json-api-vc/contributors","subscribers_url":"https://api.github.com/repos/RIKSOF/json-api-vc/subscribers","subscription_url":"https://api.github.com/repos/RIKSOF/json-api-vc/subscription","commits_url":"https://api.github.com/repos/RIKSOF/json-api-vc/commits{/sha}","git_commits_url":"https://api.github.com/repos/RIKSOF/json-api-vc/git/commits{/sha}","comments_url":"https://api.github.com/repos/RIKSOF/json-api-vc/comments{/number}","issue_comment_url":"https://api.github.com/repos/RIKSOF/json-api-vc/issues/comments{/number}","contents_url":"https://api.github.com/repos/RIKSOF/json-api-vc/contents/{+path}","compare_url":"https://api.github.com/repos/RIKSOF/json-api-vc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RIKSOF/json-api-vc/merges","archive_url":"https://api.github.com/repos/RIKSOF/json-api-vc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RIKSOF/json-api-vc/downloads","issues_url":"https://api.github.com/repos/RIKSOF/json-api-vc/issues{/number}","pulls_url":"https://api.github.com/repos/RIKSOF/json-api-vc/pulls{/number}","milestones_url":"https://api.github.com/repos/RIKSOF/json-api-vc/milestones{/number}","notifications_url":"https://api.github.com/repos/RIKSOF/json-api-vc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RIKSOF/json-api-vc/labels{/name}","releases_url":"https://api.github.com/repos/RIKSOF/json-api-vc/releases{/id}","deployments_url":"https://api.github.com/repos/RIKSOF/json-api-vc/deployments","created_at":"2016-08-20T12:20:09Z","updated_at":"2016-08-21T15:00:30Z","pushed_at":"2016-12-05T05:54:26Z","git_url":"git://github.com/RIKSOF/json-api-vc.git","ssh_url":"git@github.com:RIKSOF/json-api-vc.git","clone_url":"https://github.com/RIKSOF/json-api-vc.git","svn_url":"https://github.com/RIKSOF/json-api-vc","homepage":null,"size":739,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"RIKSOF:master","ref":"master","sha":"4e8bb50662ad3cc7f6479376a294fb574ab154e3","user":{"login":"RIKSOF","id":1582310,"avatar_url":"https://avatars.githubusercontent.com/u/1582310?v=3","gravatar_id":"","url":"https://api.github.com/users/RIKSOF","html_url":"https://github.com/RIKSOF","followers_url":"https://api.github.com/users/RIKSOF/followers","following_url":"https://api.github.com/users/RIKSOF/following{/other_user}","gists_url":"https://api.github.com/users/RIKSOF/gists{/gist_id}","starred_url":"https://api.github.com/users/RIKSOF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RIKSOF/subscriptions","organizations_url":"https://api.github.com/users/RIKSOF/orgs","repos_url":"https://api.github.com/users/RIKSOF/repos","events_url":"https://api.github.com/users/RIKSOF/events{/privacy}","received_events_url":"https://api.github.com/users/RIKSOF/received_events","type":"Organization","site_admin":false},"repo":{"id":66145247,"name":"json-api-vc","full_name":"RIKSOF/json-api-vc","owner":{"login":"RIKSOF","id":1582310,"avatar_url":"https://avatars.githubusercontent.com/u/1582310?v=3","gravatar_id":"","url":"https://api.github.com/users/RIKSOF","html_url":"https://github.com/RIKSOF","followers_url":"https://api.github.com/users/RIKSOF/followers","following_url":"https://api.github.com/users/RIKSOF/following{/other_user}","gists_url":"https://api.github.com/users/RIKSOF/gists{/gist_id}","starred_url":"https://api.github.com/users/RIKSOF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RIKSOF/subscriptions","organizations_url":"https://api.github.com/users/RIKSOF/orgs","repos_url":"https://api.github.com/users/RIKSOF/repos","events_url":"https://api.github.com/users/RIKSOF/events{/privacy}","received_events_url":"https://api.github.com/users/RIKSOF/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RIKSOF/json-api-vc","description":"A module for quickly building json api with git like version control.","fork":false,"url":"https://api.github.com/repos/RIKSOF/json-api-vc","forks_url":"https://api.github.com/repos/RIKSOF/json-api-vc/forks","keys_url":"https://api.github.com/repos/RIKSOF/json-api-vc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RIKSOF/json-api-vc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RIKSOF/json-api-vc/teams","hooks_url":"https://api.github.com/repos/RIKSOF/json-api-vc/hooks","issue_events_url":"https://api.github.com/repos/RIKSOF/json-api-vc/issues/events{/number}","events_url":"https://api.github.com/repos/RIKSOF/json-api-vc/events","assignees_url":"https://api.github.com/repos/RIKSOF/json-api-vc/assignees{/user}","branches_url":"https://api.github.com/repos/RIKSOF/json-api-vc/branches{/branch}","tags_url":"https://api.github.com/repos/RIKSOF/json-api-vc/tags","blobs_url":"https://api.github.com/repos/RIKSOF/json-api-vc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RIKSOF/json-api-vc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RIKSOF/json-api-vc/git/refs{/sha}","trees_url":"https://api.github.com/repos/RIKSOF/json-api-vc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RIKSOF/json-api-vc/statuses/{sha}","languages_url":"https://api.github.com/repos/RIKSOF/json-api-vc/languages","stargazers_url":"https://api.github.com/repos/RIKSOF/json-api-vc/stargazers","contributors_url":"https://api.github.com/repos/RIKSOF/json-api-vc/contributors","subscribers_url":"https://api.github.com/repos/RIKSOF/json-api-vc/subscribers","subscription_url":"https://api.github.com/repos/RIKSOF/json-api-vc/subscription","commits_url":"https://api.github.com/repos/RIKSOF/json-api-vc/commits{/sha}","git_commits_url":"https://api.github.com/repos/RIKSOF/json-api-vc/git/commits{/sha}","comments_url":"https://api.github.com/repos/RIKSOF/json-api-vc/comments{/number}","issue_comment_url":"https://api.github.com/repos/RIKSOF/json-api-vc/issues/comments{/number}","contents_url":"https://api.github.com/repos/RIKSOF/json-api-vc/contents/{+path}","compare_url":"https://api.github.com/repos/RIKSOF/json-api-vc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RIKSOF/json-api-vc/merges","archive_url":"https://api.github.com/repos/RIKSOF/json-api-vc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RIKSOF/json-api-vc/downloads","issues_url":"https://api.github.com/repos/RIKSOF/json-api-vc/issues{/number}","pulls_url":"https://api.github.com/repos/RIKSOF/json-api-vc/pulls{/number}","milestones_url":"https://api.github.com/repos/RIKSOF/json-api-vc/milestones{/number}","notifications_url":"https://api.github.com/repos/RIKSOF/json-api-vc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RIKSOF/json-api-vc/labels{/name}","releases_url":"https://api.github.com/repos/RIKSOF/json-api-vc/releases{/id}","deployments_url":"https://api.github.com/repos/RIKSOF/json-api-vc/deployments","created_at":"2016-08-20T12:20:09Z","updated_at":"2016-08-21T15:00:30Z","pushed_at":"2016-12-05T05:54:26Z","git_url":"git://github.com/RIKSOF/json-api-vc.git","ssh_url":"git@github.com:RIKSOF/json-api-vc.git","clone_url":"https://github.com/RIKSOF/json-api-vc.git","svn_url":"https://github.com/RIKSOF/json-api-vc","homepage":null,"size":739,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RIKSOF/json-api-vc/pulls/3"},"html":{"href":"https://github.com/RIKSOF/json-api-vc/pull/3"},"issue":{"href":"https://api.github.com/repos/RIKSOF/json-api-vc/issues/3"},"comments":{"href":"https://api.github.com/repos/RIKSOF/json-api-vc/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/RIKSOF/json-api-vc/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/RIKSOF/json-api-vc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RIKSOF/json-api-vc/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/RIKSOF/json-api-vc/statuses/2cc2ee57144a25922817db144fefde9ee9b11711"}}}}
{"actor":{"display_login":"mkhurramali"}}