{"action":"created","comment":{"url":"https://api.github.com/repos/aptible/dashboard.aptible.com/pulls/comments/87892282","pull_request_review_id":8485377,"id":87892282,"diff_hunk":"@@ -0,0 +1,127 @@\n+import Ember from 'ember';\n+import {module, test} from 'qunit';\n+import startApp from '../../helpers/start-app';\n+import { stubRequest } from '../../helpers/fake-server';\n+\n+const challengeId = 'the-user-id';\n+const verificationCode = 'the-reset-code';\n+\n+module('Acceptance: Password Reset Completion (PasswordResetChallenge workflow)', {\n+  beforeEach: function() {\n+    this.application = startApp();\n+  },\n+  afterEach: function() {\n+    Ember.run(this.application, 'destroy');\n+  }\n+});\n+\n+test('visiting /password/update/:challenge_id/:verification_code works', function(assert) {\n+  visit(`/password/update/${challengeId}/${verificationCode}`);\n+  andThen(function(){\n+    assert.equal(currentPath(), 'password.update');\n+  });\n+});\n+\n+test('visiting /password/update/:challenge_id/:verification_code signed in redirects to index', function(assert) {\n+  stubOrganization();\n+  stubStacks();\n+  signInAndVisit(`/password/update/${challengeId}/${verificationCode}`);\n+  andThen(function(){\n+    assert.equal(currentPath(), 'requires-authorization.enclave.stack.apps.index');\n+  });\n+});\n+\n+test('visiting /password/update/:challenge_id/:verification_code and submitting without password displays an error', function(assert) {\n+  assert.expect(2);\n+  visit(`/password/update/${challengeId}/${verificationCode}`);\n+  click('button:contains(Reset my password)');\n+  andThen(function(){\n+    assert.equal(currentPath(), 'password.update');\n+    var errors = find(':contains(Password can\\'t be blank)');\n+    assert.notEqual(errors.length, 0, 'errors are on the page');\n+  });\n+});\n+\n+test('visiting /password/update/:challenge_id/:verification_code and submitting without password confirmation displays an error', function(assert) {\n+  assert.expect(2);\n+  var newPassword = 'someGreatPassword1%';\n+  visit(`/password/update/${challengeId}/${verificationCode}`);\n+  fillIn('[name=password]', newPassword);\n+  click('button:contains(Reset my password)');\n+  andThen(function(){\n+    assert.equal(currentPath(), 'password.update');\n+    var errors = find(':contains(Confirmation does not match)');\n+    assert.notEqual(errors.length, 0, 'errors are on the page');\n+  });\n+});\n+\n+test('visiting /password/update/:challenge_id/:verification_code and submitting a poor password displays an error', function(assert) {\n+  assert.expect(2);\n+  var newPassword = 'somebadpassword';\n+  visit(`/password/update/${challengeId}/${verificationCode}`);\n+  fillIn('[name=password]', newPassword);\n+  click('button:contains(Reset my password)');\n+  andThen(function(){\n+    assert.equal(currentPath(), 'password.update');\n+    var errors = find(':contains(Password must)');\n+    assert.notEqual(errors.length, 0, 'errors are on the page');\n+  });\n+});\n+\n+test('visiting /password/update/:challenge_id/:verification_code and submitting a password creates a password reset', function(assert) {\n+  assert.expect(5);\n+  var challengeId = 'defResetCode';\n+  var newPassword = 'someGreatPassword1%';\n+\n+  stubRequest('post', '/verifications', function(request){\n+    var json = this.json(request);\n+    assert.equal(json.type, 'password_reset_challenge', 'type is sent');\n+    assert.equal(json.password, newPassword, 'password is sent');\n+    assert.equal(json.challenge_id, challengeId, 'challenge id is sent');\n+    assert.equal(json.verification_code, verificationCode, 'verification code is sent');\n+    return this.success({\n+      id: 'nerf'\n+    });\n+  });\n+\n+  visit(`/password/update/${challengeId}/${verificationCode}`);\n+  fillIn('[name=password]', newPassword);\n+  fillIn('[name=password-confirmation]', newPassword);\n+  click('button:contains(Reset my password)');\n+  andThen(function(){\n+    assert.equal(currentPath(), 'login');\n+  });\n+});\n+\n+test('visiting /password/update/:challenge_id/:verification_code and submitting a password handles error', function(assert) {\n+  assert.expect(2);\n+  var challengeId = 'defResetCode';\n+  var newPassword = 'someGreatPassword1%';\n+  stubRequest('post', '/verifications', function(){\n+    return this.error();\n+  });\n+\n+  visit(`/password/update/${challengeId}/${verificationCode}`);\n+  fillIn('[name=password]', newPassword);\n+  fillIn('[name=password-confirmation]', newPassword);\n+  click('button:contains(Reset my password)');\n+  andThen(function(){\n+    assert.equal(currentPath(), 'password.update');\n+    var errors = find(':contains(error resetting your password)');\n+    assert.notEqual(errors.length, 0, 'errors are on the page');\n+  });\n+\n+  andThen(() => {\n+    // TODO: remove this when on Ember Data 2.x\n+\n+    try {\n+      Ember.run(this.application, 'destroy');\n+    } catch(e) {\n+      // swallow error from Ember Data 1.0.0-beta.19.2:","path":"tests/acceptance/password/update-test.js","position":120,"original_position":120,"commit_id":"8f6bf760c9380308faeb61854ea3ec8b56bddfe9","original_commit_id":"8f6bf760c9380308faeb61854ea3ec8b56bddfe9","user":{"login":"krallin","id":1737686,"avatar_url":"https://avatars.githubusercontent.com/u/1737686?v=3","gravatar_id":"","url":"https://api.github.com/users/krallin","html_url":"https://github.com/krallin","followers_url":"https://api.github.com/users/krallin/followers","following_url":"https://api.github.com/users/krallin/following{/other_user}","gists_url":"https://api.github.com/users/krallin/gists{/gist_id}","starred_url":"https://api.github.com/users/krallin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krallin/subscriptions","organizations_url":"https://api.github.com/users/krallin/orgs","repos_url":"https://api.github.com/users/krallin/repos","events_url":"https://api.github.com/users/krallin/events{/privacy}","received_events_url":"https://api.github.com/users/krallin/received_events","type":"User","site_admin":false},"body":"Nice; thanks @bantic!","created_at":"2016-11-14T21:04:39Z","updated_at":"2016-11-14T21:04:39Z","html_url":"https://github.com/aptible/dashboard.aptible.com/pull/782#discussion_r87892282","pull_request_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/pulls/782","_links":{"self":{"href":"https://api.github.com/repos/aptible/dashboard.aptible.com/pulls/comments/87892282"},"html":{"href":"https://github.com/aptible/dashboard.aptible.com/pull/782#discussion_r87892282"},"pull_request":{"href":"https://api.github.com/repos/aptible/dashboard.aptible.com/pulls/782"}}},"pull_request":{"url":"https://api.github.com/repos/aptible/dashboard.aptible.com/pulls/782","id":93579962,"html_url":"https://github.com/aptible/dashboard.aptible.com/pull/782","diff_url":"https://github.com/aptible/dashboard.aptible.com/pull/782.diff","patch_url":"https://github.com/aptible/dashboard.aptible.com/pull/782.patch","issue_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/issues/782","number":782,"state":"open","locked":false,"title":"Challenge workflows - Stage 4","user":{"login":"krallin","id":1737686,"avatar_url":"https://avatars.githubusercontent.com/u/1737686?v=3","gravatar_id":"","url":"https://api.github.com/users/krallin","html_url":"https://github.com/krallin","followers_url":"https://api.github.com/users/krallin/followers","following_url":"https://api.github.com/users/krallin/following{/other_user}","gists_url":"https://api.github.com/users/krallin/gists{/gist_id}","starred_url":"https://api.github.com/users/krallin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krallin/subscriptions","organizations_url":"https://api.github.com/users/krallin/orgs","repos_url":"https://api.github.com/users/krallin/repos","events_url":"https://api.github.com/users/krallin/events{/privacy}","received_events_url":"https://api.github.com/users/krallin/received_events","type":"User","site_admin":false},"body":"This updates the Dashboard to use the new email verification workflows\r\nto:\r\n\r\n- Re-send email verifications (for new users).\r\n- Create an email verification challenge (when updating the user's email).\r\n\r\nFor context, see: https://github.com/aptible/auth.aptible.com/pull/255\r\n\r\n--\r\n\r\nNote: this includes https://github.com/aptible/dashboard.aptible.com/pull/777, but that PR is expected to ship earlier (see the rollout plan in https://github.com/aptible/auth.aptible.com/pull/255). The relevant commit is the other one (Stage 4).\r\n\r\ncc @sandersonet @fancyremarker @blakepettersson ","created_at":"2016-11-14T14:52:21Z","updated_at":"2016-11-14T21:04:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c39b497d0fa3796ad8ed1121e38633cf80d07628","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/pulls/782/commits","review_comments_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/pulls/782/comments","review_comment_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/issues/782/comments","statuses_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/statuses/8f6bf760c9380308faeb61854ea3ec8b56bddfe9","head":{"label":"krallin:verify-emails-s4","ref":"verify-emails-s4","sha":"8f6bf760c9380308faeb61854ea3ec8b56bddfe9","user":{"login":"krallin","id":1737686,"avatar_url":"https://avatars.githubusercontent.com/u/1737686?v=3","gravatar_id":"","url":"https://api.github.com/users/krallin","html_url":"https://github.com/krallin","followers_url":"https://api.github.com/users/krallin/followers","following_url":"https://api.github.com/users/krallin/following{/other_user}","gists_url":"https://api.github.com/users/krallin/gists{/gist_id}","starred_url":"https://api.github.com/users/krallin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krallin/subscriptions","organizations_url":"https://api.github.com/users/krallin/orgs","repos_url":"https://api.github.com/users/krallin/repos","events_url":"https://api.github.com/users/krallin/events{/privacy}","received_events_url":"https://api.github.com/users/krallin/received_events","type":"User","site_admin":false},"repo":{"id":50362094,"name":"dashboard.aptible.com","full_name":"krallin/dashboard.aptible.com","owner":{"login":"krallin","id":1737686,"avatar_url":"https://avatars.githubusercontent.com/u/1737686?v=3","gravatar_id":"","url":"https://api.github.com/users/krallin","html_url":"https://github.com/krallin","followers_url":"https://api.github.com/users/krallin/followers","following_url":"https://api.github.com/users/krallin/following{/other_user}","gists_url":"https://api.github.com/users/krallin/gists{/gist_id}","starred_url":"https://api.github.com/users/krallin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krallin/subscriptions","organizations_url":"https://api.github.com/users/krallin/orgs","repos_url":"https://api.github.com/users/krallin/repos","events_url":"https://api.github.com/users/krallin/events{/privacy}","received_events_url":"https://api.github.com/users/krallin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/krallin/dashboard.aptible.com","description":"Ember.js dashboard for the Aptible PaaS","fork":true,"url":"https://api.github.com/repos/krallin/dashboard.aptible.com","forks_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/forks","keys_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/keys{/key_id}","collaborators_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/teams","hooks_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/hooks","issue_events_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/issues/events{/number}","events_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/events","assignees_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/assignees{/user}","branches_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/branches{/branch}","tags_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/tags","blobs_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/git/refs{/sha}","trees_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/git/trees{/sha}","statuses_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/statuses/{sha}","languages_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/languages","stargazers_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/stargazers","contributors_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/contributors","subscribers_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/subscribers","subscription_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/subscription","commits_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/commits{/sha}","git_commits_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/git/commits{/sha}","comments_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/comments{/number}","issue_comment_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/issues/comments{/number}","contents_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/contents/{+path}","compare_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/compare/{base}...{head}","merges_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/merges","archive_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/downloads","issues_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/issues{/number}","pulls_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/pulls{/number}","milestones_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/milestones{/number}","notifications_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/labels{/name}","releases_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/releases{/id}","deployments_url":"https://api.github.com/repos/krallin/dashboard.aptible.com/deployments","created_at":"2016-01-25T15:59:48Z","updated_at":"2016-01-25T15:59:50Z","pushed_at":"2016-11-14T15:36:57Z","git_url":"git://github.com/krallin/dashboard.aptible.com.git","ssh_url":"git@github.com:krallin/dashboard.aptible.com.git","clone_url":"https://github.com/krallin/dashboard.aptible.com.git","svn_url":"https://github.com/krallin/dashboard.aptible.com","homepage":"https://dashboard.aptible.com","size":4024,"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":"aptible:master","ref":"master","sha":"17b08b3737389f73b21b869b633bd2843372cd07","user":{"login":"aptible","id":4594193,"avatar_url":"https://avatars.githubusercontent.com/u/4594193?v=3","gravatar_id":"","url":"https://api.github.com/users/aptible","html_url":"https://github.com/aptible","followers_url":"https://api.github.com/users/aptible/followers","following_url":"https://api.github.com/users/aptible/following{/other_user}","gists_url":"https://api.github.com/users/aptible/gists{/gist_id}","starred_url":"https://api.github.com/users/aptible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aptible/subscriptions","organizations_url":"https://api.github.com/users/aptible/orgs","repos_url":"https://api.github.com/users/aptible/repos","events_url":"https://api.github.com/users/aptible/events{/privacy}","received_events_url":"https://api.github.com/users/aptible/received_events","type":"Organization","site_admin":false},"repo":{"id":26767408,"name":"dashboard.aptible.com","full_name":"aptible/dashboard.aptible.com","owner":{"login":"aptible","id":4594193,"avatar_url":"https://avatars.githubusercontent.com/u/4594193?v=3","gravatar_id":"","url":"https://api.github.com/users/aptible","html_url":"https://github.com/aptible","followers_url":"https://api.github.com/users/aptible/followers","following_url":"https://api.github.com/users/aptible/following{/other_user}","gists_url":"https://api.github.com/users/aptible/gists{/gist_id}","starred_url":"https://api.github.com/users/aptible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aptible/subscriptions","organizations_url":"https://api.github.com/users/aptible/orgs","repos_url":"https://api.github.com/users/aptible/repos","events_url":"https://api.github.com/users/aptible/events{/privacy}","received_events_url":"https://api.github.com/users/aptible/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aptible/dashboard.aptible.com","description":"Ember.js dashboard for the Aptible PaaS","fork":false,"url":"https://api.github.com/repos/aptible/dashboard.aptible.com","forks_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/forks","keys_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/teams","hooks_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/hooks","issue_events_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/issues/events{/number}","events_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/events","assignees_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/assignees{/user}","branches_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/branches{/branch}","tags_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/tags","blobs_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/git/refs{/sha}","trees_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/statuses/{sha}","languages_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/languages","stargazers_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/stargazers","contributors_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/contributors","subscribers_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/subscribers","subscription_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/subscription","commits_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/commits{/sha}","git_commits_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/git/commits{/sha}","comments_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/comments{/number}","issue_comment_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/issues/comments{/number}","contents_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/contents/{+path}","compare_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/merges","archive_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/downloads","issues_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/issues{/number}","pulls_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/pulls{/number}","milestones_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/milestones{/number}","notifications_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/labels{/name}","releases_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/releases{/id}","deployments_url":"https://api.github.com/repos/aptible/dashboard.aptible.com/deployments","created_at":"2014-11-17T17:06:45Z","updated_at":"2016-11-05T08:42:58Z","pushed_at":"2016-11-14T17:00:00Z","git_url":"git://github.com/aptible/dashboard.aptible.com.git","ssh_url":"git@github.com:aptible/dashboard.aptible.com.git","clone_url":"https://github.com/aptible/dashboard.aptible.com.git","svn_url":"https://github.com/aptible/dashboard.aptible.com","homepage":"https://dashboard.aptible.com","size":4164,"stargazers_count":83,"watchers_count":83,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":35,"mirror_url":null,"open_issues_count":73,"forks":35,"open_issues":73,"watchers":83,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aptible/dashboard.aptible.com/pulls/782"},"html":{"href":"https://github.com/aptible/dashboard.aptible.com/pull/782"},"issue":{"href":"https://api.github.com/repos/aptible/dashboard.aptible.com/issues/782"},"comments":{"href":"https://api.github.com/repos/aptible/dashboard.aptible.com/issues/782/comments"},"review_comments":{"href":"https://api.github.com/repos/aptible/dashboard.aptible.com/pulls/782/comments"},"review_comment":{"href":"https://api.github.com/repos/aptible/dashboard.aptible.com/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aptible/dashboard.aptible.com/pulls/782/commits"},"statuses":{"href":"https://api.github.com/repos/aptible/dashboard.aptible.com/statuses/8f6bf760c9380308faeb61854ea3ec8b56bddfe9"}}}}
{"actor":{"display_login":"krallin"}}