{"action":"created","comment":{"url":"https://api.github.com/repos/RackHD/on-tasks/pulls/comments/63457953","id":63457953,"diff_hunk":"@@ -278,4 +278,121 @@ describe('Install OS Job', function () {\n             });\n         });\n     });\n+\n+    describe('test _validateOptions', function() {\n+\n+        it(\"should set name for user\", function() {\n+            _.forEach(job.options.users,function(user){\n+                expect(user).to.have.property('name');\n+            });\n+        });\n+\n+        it(\"should set name as a string\", function() {\n+            _.forEach(job.options.users,function(user){\n+                expect(user.name).to.be.a('string');\n+            });\n+        });\n+\n+        it(\"should set name match ^[A-Za-z_][A-Za-z0-9_.-]*[A-Za-z0-9_.$-]? \", function() {\n+            _.forEach(job.options.users,function(user){\n+                expect(user.name).to.match(/^[A-Za-z_][A-Za-z0-9_.-]*[A-Za-z0-9_.$-]?/);\n+            });\n+        });\n+\n+        it('should throw error when username is not given ', function() {\n+            job.options.users = [{password:'test23423', uid:600, sshKey:''}];\n+            return expect(job._validateOptions.bind(job,{}))\n+                .to.throw('username is required');\n+        });\n+\n+        it('should throw error when username is not a string ', function() {\n+            job.options.users = [{name: 100, password:'test234', uid:600, sshKey:''},\n+                                 {name: '', password:'test234', uid:600, sshKey:''}];\n+            return expect(job._validateOptions.bind(job,{}))\n+                .to.throw(Error);\n+        });\n+\n+        it('should throw error when username does not match ^[A-Za-z_][A-Za-z0-9_.-]*[A-Za-z0-9_.$-]?', function() {","path":"spec/lib/jobs/install-os-job-spec.js","position":65,"original_position":65,"commit_id":"f1467edbae3bddb2bab11a0d03cf7e6c6647a383","original_commit_id":"f1467edbae3bddb2bab11a0d03cf7e6c6647a383","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Line is too long.","created_at":"2016-05-17T02:49:22Z","updated_at":"2016-05-17T02:49:22Z","html_url":"https://github.com/RackHD/on-tasks/pull/207#discussion_r63457953","pull_request_url":"https://api.github.com/repos/RackHD/on-tasks/pulls/207","_links":{"self":{"href":"https://api.github.com/repos/RackHD/on-tasks/pulls/comments/63457953"},"html":{"href":"https://github.com/RackHD/on-tasks/pull/207#discussion_r63457953"},"pull_request":{"href":"https://api.github.com/repos/RackHD/on-tasks/pulls/207"}}},"pull_request":{"url":"https://api.github.com/repos/RackHD/on-tasks/pulls/207","id":70292567,"html_url":"https://github.com/RackHD/on-tasks/pull/207","diff_url":"https://github.com/RackHD/on-tasks/pull/207.diff","patch_url":"https://github.com/RackHD/on-tasks/pull/207.patch","issue_url":"https://api.github.com/repos/RackHD/on-tasks/issues/207","number":207,"state":"open","locked":false,"title":"add validation for users","user":{"login":"PengTian0","id":19203416,"avatar_url":"https://avatars.githubusercontent.com/u/19203416?v=3","gravatar_id":"","url":"https://api.github.com/users/PengTian0","html_url":"https://github.com/PengTian0","followers_url":"https://api.github.com/users/PengTian0/followers","following_url":"https://api.github.com/users/PengTian0/following{/other_user}","gists_url":"https://api.github.com/users/PengTian0/gists{/gist_id}","starred_url":"https://api.github.com/users/PengTian0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PengTian0/subscriptions","organizations_url":"https://api.github.com/users/PengTian0/orgs","repos_url":"https://api.github.com/users/PengTian0/repos","events_url":"https://api.github.com/users/PengTian0/events{/privacy}","received_events_url":"https://api.github.com/users/PengTian0/received_events","type":"User","site_admin":false},"body":"validate the input users date. user date should meet the following requirements:\r\n1. user name and password is required;\r\n2. user name should start with characters or _ and consist of characters and numbers and simbols such as _, -, ., $;\r\n3. the length of password should larger than 4.\r\n4. sshKey and uid is optional;\r\n5. if the uid is given, it should between 500 and 60000 (>=500, <=60000)","created_at":"2016-05-17T02:49:14Z","updated_at":"2016-05-17T02:49:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eccb51f255ecf75a8c65e674231a493d1162b027","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/RackHD/on-tasks/pulls/207/commits","review_comments_url":"https://api.github.com/repos/RackHD/on-tasks/pulls/207/comments","review_comment_url":"https://api.github.com/repos/RackHD/on-tasks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RackHD/on-tasks/issues/207/comments","statuses_url":"https://api.github.com/repos/RackHD/on-tasks/statuses/f1467edbae3bddb2bab11a0d03cf7e6c6647a383","head":{"label":"PengTian0:master","ref":"master","sha":"f1467edbae3bddb2bab11a0d03cf7e6c6647a383","user":{"login":"PengTian0","id":19203416,"avatar_url":"https://avatars.githubusercontent.com/u/19203416?v=3","gravatar_id":"","url":"https://api.github.com/users/PengTian0","html_url":"https://github.com/PengTian0","followers_url":"https://api.github.com/users/PengTian0/followers","following_url":"https://api.github.com/users/PengTian0/following{/other_user}","gists_url":"https://api.github.com/users/PengTian0/gists{/gist_id}","starred_url":"https://api.github.com/users/PengTian0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PengTian0/subscriptions","organizations_url":"https://api.github.com/users/PengTian0/orgs","repos_url":"https://api.github.com/users/PengTian0/repos","events_url":"https://api.github.com/users/PengTian0/events{/privacy}","received_events_url":"https://api.github.com/users/PengTian0/received_events","type":"User","site_admin":false},"repo":{"id":58620235,"name":"on-tasks","full_name":"PengTian0/on-tasks","owner":{"login":"PengTian0","id":19203416,"avatar_url":"https://avatars.githubusercontent.com/u/19203416?v=3","gravatar_id":"","url":"https://api.github.com/users/PengTian0","html_url":"https://github.com/PengTian0","followers_url":"https://api.github.com/users/PengTian0/followers","following_url":"https://api.github.com/users/PengTian0/following{/other_user}","gists_url":"https://api.github.com/users/PengTian0/gists{/gist_id}","starred_url":"https://api.github.com/users/PengTian0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PengTian0/subscriptions","organizations_url":"https://api.github.com/users/PengTian0/orgs","repos_url":"https://api.github.com/users/PengTian0/repos","events_url":"https://api.github.com/users/PengTian0/events{/privacy}","received_events_url":"https://api.github.com/users/PengTian0/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/PengTian0/on-tasks","description":"","fork":true,"url":"https://api.github.com/repos/PengTian0/on-tasks","forks_url":"https://api.github.com/repos/PengTian0/on-tasks/forks","keys_url":"https://api.github.com/repos/PengTian0/on-tasks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PengTian0/on-tasks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PengTian0/on-tasks/teams","hooks_url":"https://api.github.com/repos/PengTian0/on-tasks/hooks","issue_events_url":"https://api.github.com/repos/PengTian0/on-tasks/issues/events{/number}","events_url":"https://api.github.com/repos/PengTian0/on-tasks/events","assignees_url":"https://api.github.com/repos/PengTian0/on-tasks/assignees{/user}","branches_url":"https://api.github.com/repos/PengTian0/on-tasks/branches{/branch}","tags_url":"https://api.github.com/repos/PengTian0/on-tasks/tags","blobs_url":"https://api.github.com/repos/PengTian0/on-tasks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PengTian0/on-tasks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PengTian0/on-tasks/git/refs{/sha}","trees_url":"https://api.github.com/repos/PengTian0/on-tasks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PengTian0/on-tasks/statuses/{sha}","languages_url":"https://api.github.com/repos/PengTian0/on-tasks/languages","stargazers_url":"https://api.github.com/repos/PengTian0/on-tasks/stargazers","contributors_url":"https://api.github.com/repos/PengTian0/on-tasks/contributors","subscribers_url":"https://api.github.com/repos/PengTian0/on-tasks/subscribers","subscription_url":"https://api.github.com/repos/PengTian0/on-tasks/subscription","commits_url":"https://api.github.com/repos/PengTian0/on-tasks/commits{/sha}","git_commits_url":"https://api.github.com/repos/PengTian0/on-tasks/git/commits{/sha}","comments_url":"https://api.github.com/repos/PengTian0/on-tasks/comments{/number}","issue_comment_url":"https://api.github.com/repos/PengTian0/on-tasks/issues/comments{/number}","contents_url":"https://api.github.com/repos/PengTian0/on-tasks/contents/{+path}","compare_url":"https://api.github.com/repos/PengTian0/on-tasks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PengTian0/on-tasks/merges","archive_url":"https://api.github.com/repos/PengTian0/on-tasks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PengTian0/on-tasks/downloads","issues_url":"https://api.github.com/repos/PengTian0/on-tasks/issues{/number}","pulls_url":"https://api.github.com/repos/PengTian0/on-tasks/pulls{/number}","milestones_url":"https://api.github.com/repos/PengTian0/on-tasks/milestones{/number}","notifications_url":"https://api.github.com/repos/PengTian0/on-tasks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PengTian0/on-tasks/labels{/name}","releases_url":"https://api.github.com/repos/PengTian0/on-tasks/releases{/id}","deployments_url":"https://api.github.com/repos/PengTian0/on-tasks/deployments","created_at":"2016-05-12T07:52:35Z","updated_at":"2016-05-12T07:52:36Z","pushed_at":"2016-05-17T02:42:09Z","git_url":"git://github.com/PengTian0/on-tasks.git","ssh_url":"git@github.com:PengTian0/on-tasks.git","clone_url":"https://github.com/PengTian0/on-tasks.git","svn_url":"https://github.com/PengTian0/on-tasks","homepage":null,"size":1310,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"RackHD:master","ref":"master","sha":"4fa495388de058fbc7613b3c3a187c80004ff33c","user":{"login":"RackHD","id":13982662,"avatar_url":"https://avatars.githubusercontent.com/u/13982662?v=3","gravatar_id":"","url":"https://api.github.com/users/RackHD","html_url":"https://github.com/RackHD","followers_url":"https://api.github.com/users/RackHD/followers","following_url":"https://api.github.com/users/RackHD/following{/other_user}","gists_url":"https://api.github.com/users/RackHD/gists{/gist_id}","starred_url":"https://api.github.com/users/RackHD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RackHD/subscriptions","organizations_url":"https://api.github.com/users/RackHD/orgs","repos_url":"https://api.github.com/users/RackHD/repos","events_url":"https://api.github.com/users/RackHD/events{/privacy}","received_events_url":"https://api.github.com/users/RackHD/received_events","type":"Organization","site_admin":false},"repo":{"id":41690099,"name":"on-tasks","full_name":"RackHD/on-tasks","owner":{"login":"RackHD","id":13982662,"avatar_url":"https://avatars.githubusercontent.com/u/13982662?v=3","gravatar_id":"","url":"https://api.github.com/users/RackHD","html_url":"https://github.com/RackHD","followers_url":"https://api.github.com/users/RackHD/followers","following_url":"https://api.github.com/users/RackHD/following{/other_user}","gists_url":"https://api.github.com/users/RackHD/gists{/gist_id}","starred_url":"https://api.github.com/users/RackHD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RackHD/subscriptions","organizations_url":"https://api.github.com/users/RackHD/orgs","repos_url":"https://api.github.com/users/RackHD/repos","events_url":"https://api.github.com/users/RackHD/events{/privacy}","received_events_url":"https://api.github.com/users/RackHD/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RackHD/on-tasks","description":"","fork":false,"url":"https://api.github.com/repos/RackHD/on-tasks","forks_url":"https://api.github.com/repos/RackHD/on-tasks/forks","keys_url":"https://api.github.com/repos/RackHD/on-tasks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RackHD/on-tasks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RackHD/on-tasks/teams","hooks_url":"https://api.github.com/repos/RackHD/on-tasks/hooks","issue_events_url":"https://api.github.com/repos/RackHD/on-tasks/issues/events{/number}","events_url":"https://api.github.com/repos/RackHD/on-tasks/events","assignees_url":"https://api.github.com/repos/RackHD/on-tasks/assignees{/user}","branches_url":"https://api.github.com/repos/RackHD/on-tasks/branches{/branch}","tags_url":"https://api.github.com/repos/RackHD/on-tasks/tags","blobs_url":"https://api.github.com/repos/RackHD/on-tasks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RackHD/on-tasks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RackHD/on-tasks/git/refs{/sha}","trees_url":"https://api.github.com/repos/RackHD/on-tasks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RackHD/on-tasks/statuses/{sha}","languages_url":"https://api.github.com/repos/RackHD/on-tasks/languages","stargazers_url":"https://api.github.com/repos/RackHD/on-tasks/stargazers","contributors_url":"https://api.github.com/repos/RackHD/on-tasks/contributors","subscribers_url":"https://api.github.com/repos/RackHD/on-tasks/subscribers","subscription_url":"https://api.github.com/repos/RackHD/on-tasks/subscription","commits_url":"https://api.github.com/repos/RackHD/on-tasks/commits{/sha}","git_commits_url":"https://api.github.com/repos/RackHD/on-tasks/git/commits{/sha}","comments_url":"https://api.github.com/repos/RackHD/on-tasks/comments{/number}","issue_comment_url":"https://api.github.com/repos/RackHD/on-tasks/issues/comments{/number}","contents_url":"https://api.github.com/repos/RackHD/on-tasks/contents/{+path}","compare_url":"https://api.github.com/repos/RackHD/on-tasks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RackHD/on-tasks/merges","archive_url":"https://api.github.com/repos/RackHD/on-tasks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RackHD/on-tasks/downloads","issues_url":"https://api.github.com/repos/RackHD/on-tasks/issues{/number}","pulls_url":"https://api.github.com/repos/RackHD/on-tasks/pulls{/number}","milestones_url":"https://api.github.com/repos/RackHD/on-tasks/milestones{/number}","notifications_url":"https://api.github.com/repos/RackHD/on-tasks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RackHD/on-tasks/labels{/name}","releases_url":"https://api.github.com/repos/RackHD/on-tasks/releases{/id}","deployments_url":"https://api.github.com/repos/RackHD/on-tasks/deployments","created_at":"2015-08-31T17:29:32Z","updated_at":"2016-01-31T09:07:09Z","pushed_at":"2016-05-17T02:49:16Z","git_url":"git://github.com/RackHD/on-tasks.git","ssh_url":"git@github.com:RackHD/on-tasks.git","clone_url":"https://github.com/RackHD/on-tasks.git","svn_url":"https://github.com/RackHD/on-tasks","homepage":null,"size":1411,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":41,"mirror_url":null,"open_issues_count":9,"forks":41,"open_issues":9,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RackHD/on-tasks/pulls/207"},"html":{"href":"https://github.com/RackHD/on-tasks/pull/207"},"issue":{"href":"https://api.github.com/repos/RackHD/on-tasks/issues/207"},"comments":{"href":"https://api.github.com/repos/RackHD/on-tasks/issues/207/comments"},"review_comments":{"href":"https://api.github.com/repos/RackHD/on-tasks/pulls/207/comments"},"review_comment":{"href":"https://api.github.com/repos/RackHD/on-tasks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RackHD/on-tasks/pulls/207/commits"},"statuses":{"href":"https://api.github.com/repos/RackHD/on-tasks/statuses/f1467edbae3bddb2bab11a0d03cf7e6c6647a383"}}}}