{"action":"created","comment":{"url":"https://api.github.com/repos/riseshia/gannbaruzoi/pulls/comments/95070119","pull_request_review_id":15616127,"id":95070119,"diff_hunk":"@@ -69,12 +69,37 @@ defmodule Gannbaruzoi.UserTest do\n     end\n   end\n \n+  describe \"valid_token?\" do\n+    test \"returns true or false\" do\n+      email = \"hey-man@gmail.com\"\n+      insert!(:user, email: email)\n+      auth = Repo.get_by!(User, email: email)\n+             |> User.build_session()\n+             |> Repo.update!\n+             |> Map.get(:auth)\n+\n+      user = Repo.get_by!(User, email: email)\n+      now = DateTime.utc_now() |> DateTime.to_unix()\n+      fifteen_days_later = now + 60 * 60 * 24 * 14\n+\n+      assert User.valid_token?(user, auth.client, auth.token)\n+      refute User.valid_token?(user, \"wrong client\", auth.token)\n+      refute User.valid_token?(user, auth.client, \"worng token\")\n+      refute User.valid_token?(user, auth.client, auth.token,\n+                               fifteen_days_later)\n+    end\n+  end\n+\n   describe \"match_password?/2\" do\n-    test \"deletes client\" do\n+    test \"returns true or false\" do\n       password = \"alice1234\"\n-      user = insert_user(email: \"hey@gmail.com\", password: password)\n+      email = \"hey!@gmail.com\"\n+      %User{}\n+      |> User.changeset(%{email: email, password: password})","path":"test/models/user_test.exs","position":76,"original_position":76,"commit_id":"65d8801b8142492bc295248a96f22006f79af6bc","original_commit_id":"65d8801b8142492bc295248a96f22006f79af6bc","user":{"login":"marocchino","id":128431,"avatar_url":"https://avatars.githubusercontent.com/u/128431?v=3","gravatar_id":"","url":"https://api.github.com/users/marocchino","html_url":"https://github.com/marocchino","followers_url":"https://api.github.com/users/marocchino/followers","following_url":"https://api.github.com/users/marocchino/following{/other_user}","gists_url":"https://api.github.com/users/marocchino/gists{/gist_id}","starred_url":"https://api.github.com/users/marocchino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marocchino/subscriptions","organizations_url":"https://api.github.com/users/marocchino/orgs","repos_url":"https://api.github.com/users/marocchino/repos","events_url":"https://api.github.com/users/marocchino/events{/privacy}","received_events_url":"https://api.github.com/users/marocchino/received_events","type":"User","site_admin":false},"body":"I can not use factory here. if password is not in changeset ecto just ignore it.","created_at":"2017-01-08T02:18:55Z","updated_at":"2017-01-08T02:18:55Z","html_url":"https://github.com/riseshia/gannbaruzoi/pull/21#discussion_r95070119","pull_request_url":"https://api.github.com/repos/riseshia/gannbaruzoi/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/riseshia/gannbaruzoi/pulls/comments/95070119"},"html":{"href":"https://github.com/riseshia/gannbaruzoi/pull/21#discussion_r95070119"},"pull_request":{"href":"https://api.github.com/repos/riseshia/gannbaruzoi/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/riseshia/gannbaruzoi/pulls/21","id":100589488,"html_url":"https://github.com/riseshia/gannbaruzoi/pull/21","diff_url":"https://github.com/riseshia/gannbaruzoi/pull/21.diff","patch_url":"https://github.com/riseshia/gannbaruzoi/pull/21.patch","issue_url":"https://api.github.com/repos/riseshia/gannbaruzoi/issues/21","number":21,"state":"open","locked":false,"title":"Add password & token","user":{"login":"marocchino","id":128431,"avatar_url":"https://avatars.githubusercontent.com/u/128431?v=3","gravatar_id":"","url":"https://api.github.com/users/marocchino","html_url":"https://github.com/marocchino","followers_url":"https://api.github.com/users/marocchino/followers","following_url":"https://api.github.com/users/marocchino/following{/other_user}","gists_url":"https://api.github.com/users/marocchino/gists{/gist_id}","starred_url":"https://api.github.com/users/marocchino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marocchino/subscriptions","organizations_url":"https://api.github.com/users/marocchino/orgs","repos_url":"https://api.github.com/users/marocchino/repos","events_url":"https://api.github.com/users/marocchino/events{/privacy}","received_events_url":"https://api.github.com/users/marocchino/received_events","type":"User","site_admin":false},"body":"#9 ","created_at":"2017-01-08T02:14:49Z","updated_at":"2017-01-08T02:18:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fe3cbd9243157a1b90e74f62f06d96a9d00a5288","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/riseshia/gannbaruzoi/pulls/21/commits","review_comments_url":"https://api.github.com/repos/riseshia/gannbaruzoi/pulls/21/comments","review_comment_url":"https://api.github.com/repos/riseshia/gannbaruzoi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/riseshia/gannbaruzoi/issues/21/comments","statuses_url":"https://api.github.com/repos/riseshia/gannbaruzoi/statuses/65d8801b8142492bc295248a96f22006f79af6bc","head":{"label":"riseshia:pass-and-token","ref":"pass-and-token","sha":"65d8801b8142492bc295248a96f22006f79af6bc","user":{"login":"riseshia","id":7338443,"avatar_url":"https://avatars.githubusercontent.com/u/7338443?v=3","gravatar_id":"","url":"https://api.github.com/users/riseshia","html_url":"https://github.com/riseshia","followers_url":"https://api.github.com/users/riseshia/followers","following_url":"https://api.github.com/users/riseshia/following{/other_user}","gists_url":"https://api.github.com/users/riseshia/gists{/gist_id}","starred_url":"https://api.github.com/users/riseshia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/riseshia/subscriptions","organizations_url":"https://api.github.com/users/riseshia/orgs","repos_url":"https://api.github.com/users/riseshia/repos","events_url":"https://api.github.com/users/riseshia/events{/privacy}","received_events_url":"https://api.github.com/users/riseshia/received_events","type":"User","site_admin":false},"repo":{"id":75462694,"name":"gannbaruzoi","full_name":"riseshia/gannbaruzoi","owner":{"login":"riseshia","id":7338443,"avatar_url":"https://avatars.githubusercontent.com/u/7338443?v=3","gravatar_id":"","url":"https://api.github.com/users/riseshia","html_url":"https://github.com/riseshia","followers_url":"https://api.github.com/users/riseshia/followers","following_url":"https://api.github.com/users/riseshia/following{/other_user}","gists_url":"https://api.github.com/users/riseshia/gists{/gist_id}","starred_url":"https://api.github.com/users/riseshia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/riseshia/subscriptions","organizations_url":"https://api.github.com/users/riseshia/orgs","repos_url":"https://api.github.com/users/riseshia/repos","events_url":"https://api.github.com/users/riseshia/events{/privacy}","received_events_url":"https://api.github.com/users/riseshia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/riseshia/gannbaruzoi","description":"elixir graphql api server","fork":false,"url":"https://api.github.com/repos/riseshia/gannbaruzoi","forks_url":"https://api.github.com/repos/riseshia/gannbaruzoi/forks","keys_url":"https://api.github.com/repos/riseshia/gannbaruzoi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/riseshia/gannbaruzoi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/riseshia/gannbaruzoi/teams","hooks_url":"https://api.github.com/repos/riseshia/gannbaruzoi/hooks","issue_events_url":"https://api.github.com/repos/riseshia/gannbaruzoi/issues/events{/number}","events_url":"https://api.github.com/repos/riseshia/gannbaruzoi/events","assignees_url":"https://api.github.com/repos/riseshia/gannbaruzoi/assignees{/user}","branches_url":"https://api.github.com/repos/riseshia/gannbaruzoi/branches{/branch}","tags_url":"https://api.github.com/repos/riseshia/gannbaruzoi/tags","blobs_url":"https://api.github.com/repos/riseshia/gannbaruzoi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/riseshia/gannbaruzoi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/riseshia/gannbaruzoi/git/refs{/sha}","trees_url":"https://api.github.com/repos/riseshia/gannbaruzoi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/riseshia/gannbaruzoi/statuses/{sha}","languages_url":"https://api.github.com/repos/riseshia/gannbaruzoi/languages","stargazers_url":"https://api.github.com/repos/riseshia/gannbaruzoi/stargazers","contributors_url":"https://api.github.com/repos/riseshia/gannbaruzoi/contributors","subscribers_url":"https://api.github.com/repos/riseshia/gannbaruzoi/subscribers","subscription_url":"https://api.github.com/repos/riseshia/gannbaruzoi/subscription","commits_url":"https://api.github.com/repos/riseshia/gannbaruzoi/commits{/sha}","git_commits_url":"https://api.github.com/repos/riseshia/gannbaruzoi/git/commits{/sha}","comments_url":"https://api.github.com/repos/riseshia/gannbaruzoi/comments{/number}","issue_comment_url":"https://api.github.com/repos/riseshia/gannbaruzoi/issues/comments{/number}","contents_url":"https://api.github.com/repos/riseshia/gannbaruzoi/contents/{+path}","compare_url":"https://api.github.com/repos/riseshia/gannbaruzoi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/riseshia/gannbaruzoi/merges","archive_url":"https://api.github.com/repos/riseshia/gannbaruzoi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/riseshia/gannbaruzoi/downloads","issues_url":"https://api.github.com/repos/riseshia/gannbaruzoi/issues{/number}","pulls_url":"https://api.github.com/repos/riseshia/gannbaruzoi/pulls{/number}","milestones_url":"https://api.github.com/repos/riseshia/gannbaruzoi/milestones{/number}","notifications_url":"https://api.github.com/repos/riseshia/gannbaruzoi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/riseshia/gannbaruzoi/labels{/name}","releases_url":"https://api.github.com/repos/riseshia/gannbaruzoi/releases{/id}","deployments_url":"https://api.github.com/repos/riseshia/gannbaruzoi/deployments","created_at":"2016-12-03T08:46:00Z","updated_at":"2017-01-07T08:47:24Z","pushed_at":"2017-01-08T02:14:49Z","git_url":"git://github.com/riseshia/gannbaruzoi.git","ssh_url":"git@github.com:riseshia/gannbaruzoi.git","clone_url":"https://github.com/riseshia/gannbaruzoi.git","svn_url":"https://github.com/riseshia/gannbaruzoi","homepage":null,"size":101,"stargazers_count":0,"watchers_count":0,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"base":{"label":"riseshia:master","ref":"master","sha":"c660b74ab341ca2079e5366451ed9483ee545451","user":{"login":"riseshia","id":7338443,"avatar_url":"https://avatars.githubusercontent.com/u/7338443?v=3","gravatar_id":"","url":"https://api.github.com/users/riseshia","html_url":"https://github.com/riseshia","followers_url":"https://api.github.com/users/riseshia/followers","following_url":"https://api.github.com/users/riseshia/following{/other_user}","gists_url":"https://api.github.com/users/riseshia/gists{/gist_id}","starred_url":"https://api.github.com/users/riseshia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/riseshia/subscriptions","organizations_url":"https://api.github.com/users/riseshia/orgs","repos_url":"https://api.github.com/users/riseshia/repos","events_url":"https://api.github.com/users/riseshia/events{/privacy}","received_events_url":"https://api.github.com/users/riseshia/received_events","type":"User","site_admin":false},"repo":{"id":75462694,"name":"gannbaruzoi","full_name":"riseshia/gannbaruzoi","owner":{"login":"riseshia","id":7338443,"avatar_url":"https://avatars.githubusercontent.com/u/7338443?v=3","gravatar_id":"","url":"https://api.github.com/users/riseshia","html_url":"https://github.com/riseshia","followers_url":"https://api.github.com/users/riseshia/followers","following_url":"https://api.github.com/users/riseshia/following{/other_user}","gists_url":"https://api.github.com/users/riseshia/gists{/gist_id}","starred_url":"https://api.github.com/users/riseshia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/riseshia/subscriptions","organizations_url":"https://api.github.com/users/riseshia/orgs","repos_url":"https://api.github.com/users/riseshia/repos","events_url":"https://api.github.com/users/riseshia/events{/privacy}","received_events_url":"https://api.github.com/users/riseshia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/riseshia/gannbaruzoi","description":"elixir graphql api server","fork":false,"url":"https://api.github.com/repos/riseshia/gannbaruzoi","forks_url":"https://api.github.com/repos/riseshia/gannbaruzoi/forks","keys_url":"https://api.github.com/repos/riseshia/gannbaruzoi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/riseshia/gannbaruzoi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/riseshia/gannbaruzoi/teams","hooks_url":"https://api.github.com/repos/riseshia/gannbaruzoi/hooks","issue_events_url":"https://api.github.com/repos/riseshia/gannbaruzoi/issues/events{/number}","events_url":"https://api.github.com/repos/riseshia/gannbaruzoi/events","assignees_url":"https://api.github.com/repos/riseshia/gannbaruzoi/assignees{/user}","branches_url":"https://api.github.com/repos/riseshia/gannbaruzoi/branches{/branch}","tags_url":"https://api.github.com/repos/riseshia/gannbaruzoi/tags","blobs_url":"https://api.github.com/repos/riseshia/gannbaruzoi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/riseshia/gannbaruzoi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/riseshia/gannbaruzoi/git/refs{/sha}","trees_url":"https://api.github.com/repos/riseshia/gannbaruzoi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/riseshia/gannbaruzoi/statuses/{sha}","languages_url":"https://api.github.com/repos/riseshia/gannbaruzoi/languages","stargazers_url":"https://api.github.com/repos/riseshia/gannbaruzoi/stargazers","contributors_url":"https://api.github.com/repos/riseshia/gannbaruzoi/contributors","subscribers_url":"https://api.github.com/repos/riseshia/gannbaruzoi/subscribers","subscription_url":"https://api.github.com/repos/riseshia/gannbaruzoi/subscription","commits_url":"https://api.github.com/repos/riseshia/gannbaruzoi/commits{/sha}","git_commits_url":"https://api.github.com/repos/riseshia/gannbaruzoi/git/commits{/sha}","comments_url":"https://api.github.com/repos/riseshia/gannbaruzoi/comments{/number}","issue_comment_url":"https://api.github.com/repos/riseshia/gannbaruzoi/issues/comments{/number}","contents_url":"https://api.github.com/repos/riseshia/gannbaruzoi/contents/{+path}","compare_url":"https://api.github.com/repos/riseshia/gannbaruzoi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/riseshia/gannbaruzoi/merges","archive_url":"https://api.github.com/repos/riseshia/gannbaruzoi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/riseshia/gannbaruzoi/downloads","issues_url":"https://api.github.com/repos/riseshia/gannbaruzoi/issues{/number}","pulls_url":"https://api.github.com/repos/riseshia/gannbaruzoi/pulls{/number}","milestones_url":"https://api.github.com/repos/riseshia/gannbaruzoi/milestones{/number}","notifications_url":"https://api.github.com/repos/riseshia/gannbaruzoi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/riseshia/gannbaruzoi/labels{/name}","releases_url":"https://api.github.com/repos/riseshia/gannbaruzoi/releases{/id}","deployments_url":"https://api.github.com/repos/riseshia/gannbaruzoi/deployments","created_at":"2016-12-03T08:46:00Z","updated_at":"2017-01-07T08:47:24Z","pushed_at":"2017-01-08T02:14:49Z","git_url":"git://github.com/riseshia/gannbaruzoi.git","ssh_url":"git@github.com:riseshia/gannbaruzoi.git","clone_url":"https://github.com/riseshia/gannbaruzoi.git","svn_url":"https://github.com/riseshia/gannbaruzoi","homepage":null,"size":101,"stargazers_count":0,"watchers_count":0,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/riseshia/gannbaruzoi/pulls/21"},"html":{"href":"https://github.com/riseshia/gannbaruzoi/pull/21"},"issue":{"href":"https://api.github.com/repos/riseshia/gannbaruzoi/issues/21"},"comments":{"href":"https://api.github.com/repos/riseshia/gannbaruzoi/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/riseshia/gannbaruzoi/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/riseshia/gannbaruzoi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/riseshia/gannbaruzoi/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/riseshia/gannbaruzoi/statuses/65d8801b8142492bc295248a96f22006f79af6bc"}}}}
{"actor":{"display_login":"marocchino"}}