{"action":"created","comment":{"url":"https://api.github.com/repos/edenlabllc/ehealth.api/pulls/comments/176728584","pull_request_review_id":106484838,"id":176728584,"diff_hunk":"@@ -3,53 +3,44 @@ defmodule EHealth.Unit.EmployeeRequestsTest do\n \n   use EHealth.Web.ConnCase, async: false\n \n-  import Ecto.Query\n   alias EHealth.EmployeeRequests\n   alias EHealth.EmployeeRequests.EmployeeRequest, as: Request\n   alias EHealth.EventManagerRepo\n   alias EHealth.EventManager.Event\n   alias EHealth.Repo\n   alias Ecto.UUID\n \n+  @expired_status Request.status(:expired)\n+\n   test \"terminate outdated employee_requests\" do\n     employee_id = UUID.generate()\n-    employee_request1 = insert(:il, :employee_request, employee_id: employee_id)\n-    employee_request2 = insert(:il, :employee_request)\n-    insert(:il, :employee_request)\n-    inserted_at = NaiveDateTime.add(NaiveDateTime.utc_now(), -86_400 * 10, :seconds)\n-\n-    employee_request1\n-    |> Ecto.Changeset.change(inserted_at: inserted_at)\n-    |> Repo.update()\n-\n-    employee_request2\n-    |> Ecto.Changeset.change(inserted_at: NaiveDateTime.add(inserted_at, 10, :seconds))\n-    |> Repo.update()\n+    inserted_at = Timex.shift(NaiveDateTime.utc_now(), days: -10)\n \n-    assert 3 = Request |> Repo.all() |> Enum.count()\n+    employee_request_expired = insert(:il, :employee_request, employee_id: employee_id, inserted_at: inserted_at)\n+    _employee_request_expired2 = insert(:il, :employee_request, inserted_at: inserted_at)","path":"apps/ehealth/test/unit/employee_requests/employee_requests_test.exs","position":32,"original_position":32,"commit_id":"f987132fe3d394dff6edf2a1c4ecf10f707958e4","original_commit_id":"f987132fe3d394dff6edf2a1c4ecf10f707958e4","user":{"login":"progsmile","id":6272773,"avatar_url":"https://avatars3.githubusercontent.com/u/6272773?v=4","gravatar_id":"","url":"https://api.github.com/users/progsmile","html_url":"https://github.com/progsmile","followers_url":"https://api.github.com/users/progsmile/followers","following_url":"https://api.github.com/users/progsmile/following{/other_user}","gists_url":"https://api.github.com/users/progsmile/gists{/gist_id}","starred_url":"https://api.github.com/users/progsmile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/progsmile/subscriptions","organizations_url":"https://api.github.com/users/progsmile/orgs","repos_url":"https://api.github.com/users/progsmile/repos","events_url":"https://api.github.com/users/progsmile/events{/privacy}","received_events_url":"https://api.github.com/users/progsmile/received_events","type":"User","site_admin":false},"body":"I left it for code readability)","created_at":"2018-03-23T13:10:20Z","updated_at":"2018-03-23T13:10:20Z","html_url":"https://github.com/edenlabllc/ehealth.api/pull/2004#discussion_r176728584","pull_request_url":"https://api.github.com/repos/edenlabllc/ehealth.api/pulls/2004","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/edenlabllc/ehealth.api/pulls/comments/176728584"},"html":{"href":"https://github.com/edenlabllc/ehealth.api/pull/2004#discussion_r176728584"},"pull_request":{"href":"https://api.github.com/repos/edenlabllc/ehealth.api/pulls/2004"}},"in_reply_to_id":176721670},"pull_request":{"url":"https://api.github.com/repos/edenlabllc/ehealth.api/pulls/2004","id":177047271,"html_url":"https://github.com/edenlabllc/ehealth.api/pull/2004","diff_url":"https://github.com/edenlabllc/ehealth.api/pull/2004.diff","patch_url":"https://github.com/edenlabllc/ehealth.api/pull/2004.patch","issue_url":"https://api.github.com/repos/edenlabllc/ehealth.api/issues/2004","number":2004,"state":"open","locked":false,"title":"[Patch] Fix terminate outdated employee requests test","user":{"login":"progsmile","id":6272773,"avatar_url":"https://avatars3.githubusercontent.com/u/6272773?v=4","gravatar_id":"","url":"https://api.github.com/users/progsmile","html_url":"https://github.com/progsmile","followers_url":"https://api.github.com/users/progsmile/followers","following_url":"https://api.github.com/users/progsmile/following{/other_user}","gists_url":"https://api.github.com/users/progsmile/gists{/gist_id}","starred_url":"https://api.github.com/users/progsmile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/progsmile/subscriptions","organizations_url":"https://api.github.com/users/progsmile/orgs","repos_url":"https://api.github.com/users/progsmile/repos","events_url":"https://api.github.com/users/progsmile/events{/privacy}","received_events_url":"https://api.github.com/users/progsmile/received_events","type":"User","site_admin":false},"body":"Fix terminate outdated employee requests test\r\n[Issue](https://github.com/edenlabllc/ehealth.api/issues/1977)","created_at":"2018-03-23T11:52:42Z","updated_at":"2018-03-23T13:10:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c97261823e364a60b2127b251d680cb91697518d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/edenlabllc/ehealth.api/pulls/2004/commits","review_comments_url":"https://api.github.com/repos/edenlabllc/ehealth.api/pulls/2004/comments","review_comment_url":"https://api.github.com/repos/edenlabllc/ehealth.api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edenlabllc/ehealth.api/issues/2004/comments","statuses_url":"https://api.github.com/repos/edenlabllc/ehealth.api/statuses/f987132fe3d394dff6edf2a1c4ecf10f707958e4","head":{"label":"edenlabllc:fix-1977-random-employee-requests-test-fail","ref":"fix-1977-random-employee-requests-test-fail","sha":"f987132fe3d394dff6edf2a1c4ecf10f707958e4","user":{"login":"edenlabllc","id":29564877,"avatar_url":"https://avatars1.githubusercontent.com/u/29564877?v=4","gravatar_id":"","url":"https://api.github.com/users/edenlabllc","html_url":"https://github.com/edenlabllc","followers_url":"https://api.github.com/users/edenlabllc/followers","following_url":"https://api.github.com/users/edenlabllc/following{/other_user}","gists_url":"https://api.github.com/users/edenlabllc/gists{/gist_id}","starred_url":"https://api.github.com/users/edenlabllc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edenlabllc/subscriptions","organizations_url":"https://api.github.com/users/edenlabllc/orgs","repos_url":"https://api.github.com/users/edenlabllc/repos","events_url":"https://api.github.com/users/edenlabllc/events{/privacy}","received_events_url":"https://api.github.com/users/edenlabllc/received_events","type":"Organization","site_admin":false},"repo":{"id":83801950,"name":"ehealth.api","full_name":"edenlabllc/ehealth.api","owner":{"login":"edenlabllc","id":29564877,"avatar_url":"https://avatars1.githubusercontent.com/u/29564877?v=4","gravatar_id":"","url":"https://api.github.com/users/edenlabllc","html_url":"https://github.com/edenlabllc","followers_url":"https://api.github.com/users/edenlabllc/followers","following_url":"https://api.github.com/users/edenlabllc/following{/other_user}","gists_url":"https://api.github.com/users/edenlabllc/gists{/gist_id}","starred_url":"https://api.github.com/users/edenlabllc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edenlabllc/subscriptions","organizations_url":"https://api.github.com/users/edenlabllc/orgs","repos_url":"https://api.github.com/users/edenlabllc/repos","events_url":"https://api.github.com/users/edenlabllc/events{/privacy}","received_events_url":"https://api.github.com/users/edenlabllc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edenlabllc/ehealth.api","description":"Index page and integration layer for projects that related to Ukrainian Health Services government institution.","fork":false,"url":"https://api.github.com/repos/edenlabllc/ehealth.api","forks_url":"https://api.github.com/repos/edenlabllc/ehealth.api/forks","keys_url":"https://api.github.com/repos/edenlabllc/ehealth.api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edenlabllc/ehealth.api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edenlabllc/ehealth.api/teams","hooks_url":"https://api.github.com/repos/edenlabllc/ehealth.api/hooks","issue_events_url":"https://api.github.com/repos/edenlabllc/ehealth.api/issues/events{/number}","events_url":"https://api.github.com/repos/edenlabllc/ehealth.api/events","assignees_url":"https://api.github.com/repos/edenlabllc/ehealth.api/assignees{/user}","branches_url":"https://api.github.com/repos/edenlabllc/ehealth.api/branches{/branch}","tags_url":"https://api.github.com/repos/edenlabllc/ehealth.api/tags","blobs_url":"https://api.github.com/repos/edenlabllc/ehealth.api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edenlabllc/ehealth.api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edenlabllc/ehealth.api/git/refs{/sha}","trees_url":"https://api.github.com/repos/edenlabllc/ehealth.api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edenlabllc/ehealth.api/statuses/{sha}","languages_url":"https://api.github.com/repos/edenlabllc/ehealth.api/languages","stargazers_url":"https://api.github.com/repos/edenlabllc/ehealth.api/stargazers","contributors_url":"https://api.github.com/repos/edenlabllc/ehealth.api/contributors","subscribers_url":"https://api.github.com/repos/edenlabllc/ehealth.api/subscribers","subscription_url":"https://api.github.com/repos/edenlabllc/ehealth.api/subscription","commits_url":"https://api.github.com/repos/edenlabllc/ehealth.api/commits{/sha}","git_commits_url":"https://api.github.com/repos/edenlabllc/ehealth.api/git/commits{/sha}","comments_url":"https://api.github.com/repos/edenlabllc/ehealth.api/comments{/number}","issue_comment_url":"https://api.github.com/repos/edenlabllc/ehealth.api/issues/comments{/number}","contents_url":"https://api.github.com/repos/edenlabllc/ehealth.api/contents/{+path}","compare_url":"https://api.github.com/repos/edenlabllc/ehealth.api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edenlabllc/ehealth.api/merges","archive_url":"https://api.github.com/repos/edenlabllc/ehealth.api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edenlabllc/ehealth.api/downloads","issues_url":"https://api.github.com/repos/edenlabllc/ehealth.api/issues{/number}","pulls_url":"https://api.github.com/repos/edenlabllc/ehealth.api/pulls{/number}","milestones_url":"https://api.github.com/repos/edenlabllc/ehealth.api/milestones{/number}","notifications_url":"https://api.github.com/repos/edenlabllc/ehealth.api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edenlabllc/ehealth.api/labels{/name}","releases_url":"https://api.github.com/repos/edenlabllc/ehealth.api/releases{/id}","deployments_url":"https://api.github.com/repos/edenlabllc/ehealth.api/deployments","created_at":"2017-03-03T13:40:00Z","updated_at":"2018-03-23T10:32:49Z","pushed_at":"2018-03-23T11:56:10Z","git_url":"git://github.com/edenlabllc/ehealth.api.git","ssh_url":"git@github.com:edenlabllc/ehealth.api.git","clone_url":"https://github.com/edenlabllc/ehealth.api.git","svn_url":"https://github.com/edenlabllc/ehealth.api","homepage":"","size":4781,"stargazers_count":65,"watchers_count":65,"language":"Elixir","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"archived":false,"open_issues_count":128,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":14,"open_issues":128,"watchers":65,"default_branch":"master"}},"base":{"label":"edenlabllc:master","ref":"master","sha":"aaa1294556d59c20cbfe89bc34b381287e86ba74","user":{"login":"edenlabllc","id":29564877,"avatar_url":"https://avatars1.githubusercontent.com/u/29564877?v=4","gravatar_id":"","url":"https://api.github.com/users/edenlabllc","html_url":"https://github.com/edenlabllc","followers_url":"https://api.github.com/users/edenlabllc/followers","following_url":"https://api.github.com/users/edenlabllc/following{/other_user}","gists_url":"https://api.github.com/users/edenlabllc/gists{/gist_id}","starred_url":"https://api.github.com/users/edenlabllc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edenlabllc/subscriptions","organizations_url":"https://api.github.com/users/edenlabllc/orgs","repos_url":"https://api.github.com/users/edenlabllc/repos","events_url":"https://api.github.com/users/edenlabllc/events{/privacy}","received_events_url":"https://api.github.com/users/edenlabllc/received_events","type":"Organization","site_admin":false},"repo":{"id":83801950,"name":"ehealth.api","full_name":"edenlabllc/ehealth.api","owner":{"login":"edenlabllc","id":29564877,"avatar_url":"https://avatars1.githubusercontent.com/u/29564877?v=4","gravatar_id":"","url":"https://api.github.com/users/edenlabllc","html_url":"https://github.com/edenlabllc","followers_url":"https://api.github.com/users/edenlabllc/followers","following_url":"https://api.github.com/users/edenlabllc/following{/other_user}","gists_url":"https://api.github.com/users/edenlabllc/gists{/gist_id}","starred_url":"https://api.github.com/users/edenlabllc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edenlabllc/subscriptions","organizations_url":"https://api.github.com/users/edenlabllc/orgs","repos_url":"https://api.github.com/users/edenlabllc/repos","events_url":"https://api.github.com/users/edenlabllc/events{/privacy}","received_events_url":"https://api.github.com/users/edenlabllc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edenlabllc/ehealth.api","description":"Index page and integration layer for projects that related to Ukrainian Health Services government institution.","fork":false,"url":"https://api.github.com/repos/edenlabllc/ehealth.api","forks_url":"https://api.github.com/repos/edenlabllc/ehealth.api/forks","keys_url":"https://api.github.com/repos/edenlabllc/ehealth.api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edenlabllc/ehealth.api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edenlabllc/ehealth.api/teams","hooks_url":"https://api.github.com/repos/edenlabllc/ehealth.api/hooks","issue_events_url":"https://api.github.com/repos/edenlabllc/ehealth.api/issues/events{/number}","events_url":"https://api.github.com/repos/edenlabllc/ehealth.api/events","assignees_url":"https://api.github.com/repos/edenlabllc/ehealth.api/assignees{/user}","branches_url":"https://api.github.com/repos/edenlabllc/ehealth.api/branches{/branch}","tags_url":"https://api.github.com/repos/edenlabllc/ehealth.api/tags","blobs_url":"https://api.github.com/repos/edenlabllc/ehealth.api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edenlabllc/ehealth.api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edenlabllc/ehealth.api/git/refs{/sha}","trees_url":"https://api.github.com/repos/edenlabllc/ehealth.api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edenlabllc/ehealth.api/statuses/{sha}","languages_url":"https://api.github.com/repos/edenlabllc/ehealth.api/languages","stargazers_url":"https://api.github.com/repos/edenlabllc/ehealth.api/stargazers","contributors_url":"https://api.github.com/repos/edenlabllc/ehealth.api/contributors","subscribers_url":"https://api.github.com/repos/edenlabllc/ehealth.api/subscribers","subscription_url":"https://api.github.com/repos/edenlabllc/ehealth.api/subscription","commits_url":"https://api.github.com/repos/edenlabllc/ehealth.api/commits{/sha}","git_commits_url":"https://api.github.com/repos/edenlabllc/ehealth.api/git/commits{/sha}","comments_url":"https://api.github.com/repos/edenlabllc/ehealth.api/comments{/number}","issue_comment_url":"https://api.github.com/repos/edenlabllc/ehealth.api/issues/comments{/number}","contents_url":"https://api.github.com/repos/edenlabllc/ehealth.api/contents/{+path}","compare_url":"https://api.github.com/repos/edenlabllc/ehealth.api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edenlabllc/ehealth.api/merges","archive_url":"https://api.github.com/repos/edenlabllc/ehealth.api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edenlabllc/ehealth.api/downloads","issues_url":"https://api.github.com/repos/edenlabllc/ehealth.api/issues{/number}","pulls_url":"https://api.github.com/repos/edenlabllc/ehealth.api/pulls{/number}","milestones_url":"https://api.github.com/repos/edenlabllc/ehealth.api/milestones{/number}","notifications_url":"https://api.github.com/repos/edenlabllc/ehealth.api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edenlabllc/ehealth.api/labels{/name}","releases_url":"https://api.github.com/repos/edenlabllc/ehealth.api/releases{/id}","deployments_url":"https://api.github.com/repos/edenlabllc/ehealth.api/deployments","created_at":"2017-03-03T13:40:00Z","updated_at":"2018-03-23T10:32:49Z","pushed_at":"2018-03-23T11:56:10Z","git_url":"git://github.com/edenlabllc/ehealth.api.git","ssh_url":"git@github.com:edenlabllc/ehealth.api.git","clone_url":"https://github.com/edenlabllc/ehealth.api.git","svn_url":"https://github.com/edenlabllc/ehealth.api","homepage":"","size":4781,"stargazers_count":65,"watchers_count":65,"language":"Elixir","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"archived":false,"open_issues_count":128,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":14,"open_issues":128,"watchers":65,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edenlabllc/ehealth.api/pulls/2004"},"html":{"href":"https://github.com/edenlabllc/ehealth.api/pull/2004"},"issue":{"href":"https://api.github.com/repos/edenlabllc/ehealth.api/issues/2004"},"comments":{"href":"https://api.github.com/repos/edenlabllc/ehealth.api/issues/2004/comments"},"review_comments":{"href":"https://api.github.com/repos/edenlabllc/ehealth.api/pulls/2004/comments"},"review_comment":{"href":"https://api.github.com/repos/edenlabllc/ehealth.api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edenlabllc/ehealth.api/pulls/2004/commits"},"statuses":{"href":"https://api.github.com/repos/edenlabllc/ehealth.api/statuses/f987132fe3d394dff6edf2a1c4ecf10f707958e4"}},"author_association":"NONE"}}
{"actor":{"display_login":"progsmile"}}