{"action":"created","comment":{"url":"https://api.github.com/repos/aviabird/snitch/pulls/comments/203628118","pull_request_review_id":138553424,"id":203628118,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMzYyODExOA==","diff_hunk":"@@ -0,0 +1,74 @@\n+defmodule SnitchApiWeb.LineItemControllerTest do\n+  use SnitchApiWeb.ConnCase, async: true\n+  import Plug.Conn\n+  alias Snitch.Repo\n+  alias SnitchApi.Accounts\n+  import Snitch.Factory\n+  # alias Snitch.Data.Model.Order, as: OrderModel\n+\n+  setup %{conn: conn} do\n+    conn =\n+      conn\n+      |> put_req_header(\"accept\", \"application/vnd.api+json\")\n+      |> put_req_header(\"content-type\", \"application/vnd.api+json\")\n+\n+    user = build(:user_with_no_role)\n+\n+    role = build(:role, name: \"user\")\n+\n+    Repo.insert(role, on_conflict: :nothing)\n+\n+    {:ok, registered_user} = Accounts.create_user(user)\n+\n+    # create the token\n+    {:ok, token, _claims} = SnitchApi.Guardian.encode_and_sign(registered_user)\n+\n+    # add authorization header to request\n+    conn = conn |> put_req_header(\"authorization\", \"Bearer #{token}\")\n+\n+    conn = assign(conn, :current_user, registered_user)\n+\n+    # pass the connection and the user to the test\n+\n+    {:ok, conn: conn}\n+  end\n+\n+  describe \"Line Items\" do\n+    test \"Adding new item\", %{conn: conn} do\n+      user = conn.assigns[:current_user]\n+      order = insert(:order, user_id: user.id)\n+\n+      variant =\n+        insert(:variant, product: insert(:product), shipping_category: insert(:shipping_category))\n+\n+      line_item =\n+        :line_item\n+        |> build(unit_price: nil)\n+        |> Map.take([:quantity, :unit_price])","path":"apps/snitch_api/test/snitch_api_web/controllers/line_item_controller_test.exs","position":47,"original_position":47,"commit_id":"4f30d2579cb027b4052bde8f01b4954fce762808","original_commit_id":"4f30d2579cb027b4052bde8f01b4954fce762808","user":{"login":"pkrawat1","id":3807725,"node_id":"MDQ6VXNlcjM4MDc3MjU=","avatar_url":"https://avatars2.githubusercontent.com/u/3807725?v=4","gravatar_id":"","url":"https://api.github.com/users/pkrawat1","html_url":"https://github.com/pkrawat1","followers_url":"https://api.github.com/users/pkrawat1/followers","following_url":"https://api.github.com/users/pkrawat1/following{/other_user}","gists_url":"https://api.github.com/users/pkrawat1/gists{/gist_id}","starred_url":"https://api.github.com/users/pkrawat1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkrawat1/subscriptions","organizations_url":"https://api.github.com/users/pkrawat1/orgs","repos_url":"https://api.github.com/users/pkrawat1/repos","events_url":"https://api.github.com/users/pkrawat1/events{/privacy}","received_events_url":"https://api.github.com/users/pkrawat1/received_events","type":"User","site_admin":false},"body":"ok\r\n","created_at":"2018-07-19T07:39:10Z","updated_at":"2018-07-19T07:39:10Z","html_url":"https://github.com/aviabird/snitch/pull/147#discussion_r203628118","pull_request_url":"https://api.github.com/repos/aviabird/snitch/pulls/147","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/aviabird/snitch/pulls/comments/203628118"},"html":{"href":"https://github.com/aviabird/snitch/pull/147#discussion_r203628118"},"pull_request":{"href":"https://api.github.com/repos/aviabird/snitch/pulls/147"}},"in_reply_to_id":203326042},"pull_request":{"url":"https://api.github.com/repos/aviabird/snitch/pulls/147","id":202063379,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyMDYzMzc5","html_url":"https://github.com/aviabird/snitch/pull/147","diff_url":"https://github.com/aviabird/snitch/pull/147.diff","patch_url":"https://github.com/aviabird/snitch/pull/147.patch","issue_url":"https://api.github.com/repos/aviabird/snitch/issues/147","number":147,"state":"open","locked":false,"title":"Adding and Updating line_item to an order","user":{"login":"blackode","id":9107477,"node_id":"MDQ6VXNlcjkxMDc0Nzc=","avatar_url":"https://avatars2.githubusercontent.com/u/9107477?v=4","gravatar_id":"","url":"https://api.github.com/users/blackode","html_url":"https://github.com/blackode","followers_url":"https://api.github.com/users/blackode/followers","following_url":"https://api.github.com/users/blackode/following{/other_user}","gists_url":"https://api.github.com/users/blackode/gists{/gist_id}","starred_url":"https://api.github.com/users/blackode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blackode/subscriptions","organizations_url":"https://api.github.com/users/blackode/orgs","repos_url":"https://api.github.com/users/blackode/repos","events_url":"https://api.github.com/users/blackode/events{/privacy}","received_events_url":"https://api.github.com/users/blackode/received_events","type":"User","site_admin":false},"body":"This provides an API for adding and updating the line_item for\r\nan order.\r\n\r\n<!--- Provide a general summary of your changes in the Title above -->\r\n<!--- in NOT MORE THAN 50 characters. Keep it short, pls. -->\r\n\r\n\r\n<!-- If this is a relatively large or complex change, kick off the discussion by -->\r\n<!-- explaining why you chose the solution you did and what alternatives you -->\r\n<!-- considered, etc... -->\r\n\r\n------\r\n\r\n## Checklist\r\n<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->\r\n<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\r\n- [ ] I have read [CONTRIBUTING.md][contributing].\r\n- [ ] My code follows the [style guidelines][contributing] of this project.\r\n- [ ] I have commented my code, particularly in hard-to-understand areas.\r\n- [ ] My code does not generate any (new) [`credo`][credo] and compile-time warnings.\r\n- [ ] I have updated the documentation wherever necessary.\r\n- [ ] I have added tests to cover my changes.\r\n\r\n[contributing]: https://github.com/aviabird/snitch/CONTRIBUTING.md\r\n[credo]: https://github.com/rrrene/credo\r\n\r\n<!--- DO NOT REMOVE SECTION BELOW -->\r\n------\r\nDear Gatekeeper,\r\n\r\nPlease make sure that the commits that will be merged or rebased into the base\r\nbranch are [formatted according to our standards][commit-style].\r\n\r\n> The only additional requirement is that the the PR number must appear in the\r\n> commit title in brackets: `(#XXX)`\r\n\r\n[commit-style]: https://github.com/aviabird/snitch/blob/develop/CONTRIBUTING.md#styling\r\n","created_at":"2018-07-17T20:41:39Z","updated_at":"2018-07-19T07:39:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5075920201587dd6ab48e71deaf6736b5602271e","assignee":null,"assignees":[],"requested_reviewers":[{"login":"arjun289","id":9413385,"node_id":"MDQ6VXNlcjk0MTMzODU=","avatar_url":"https://avatars0.githubusercontent.com/u/9413385?v=4","gravatar_id":"","url":"https://api.github.com/users/arjun289","html_url":"https://github.com/arjun289","followers_url":"https://api.github.com/users/arjun289/followers","following_url":"https://api.github.com/users/arjun289/following{/other_user}","gists_url":"https://api.github.com/users/arjun289/gists{/gist_id}","starred_url":"https://api.github.com/users/arjun289/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arjun289/subscriptions","organizations_url":"https://api.github.com/users/arjun289/orgs","repos_url":"https://api.github.com/users/arjun289/repos","events_url":"https://api.github.com/users/arjun289/events{/privacy}","received_events_url":"https://api.github.com/users/arjun289/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":952070311,"node_id":"MDU6TGFiZWw5NTIwNzAzMTE=","url":"https://api.github.com/repos/aviabird/snitch/labels/DONT%20MERGE","name":"DONT MERGE","color":"d93f0b","default":false},{"id":838344040,"node_id":"MDU6TGFiZWw4MzgzNDQwNDA=","url":"https://api.github.com/repos/aviabird/snitch/labels/WIP","name":"WIP","color":"f78a8f","default":false},{"id":833098563,"node_id":"MDU6TGFiZWw4MzMwOTg1NjM=","url":"https://api.github.com/repos/aviabird/snitch/labels/help%20wanted","name":"help wanted","color":"008672","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/aviabird/snitch/pulls/147/commits","review_comments_url":"https://api.github.com/repos/aviabird/snitch/pulls/147/comments","review_comment_url":"https://api.github.com/repos/aviabird/snitch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aviabird/snitch/issues/147/comments","statuses_url":"https://api.github.com/repos/aviabird/snitch/statuses/4f30d2579cb027b4052bde8f01b4954fce762808","head":{"label":"aviabird:add-upadate-line-item-to-order","ref":"add-upadate-line-item-to-order","sha":"4f30d2579cb027b4052bde8f01b4954fce762808","user":{"login":"aviabird","id":22424801,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyNDI0ODAx","avatar_url":"https://avatars3.githubusercontent.com/u/22424801?v=4","gravatar_id":"","url":"https://api.github.com/users/aviabird","html_url":"https://github.com/aviabird","followers_url":"https://api.github.com/users/aviabird/followers","following_url":"https://api.github.com/users/aviabird/following{/other_user}","gists_url":"https://api.github.com/users/aviabird/gists{/gist_id}","starred_url":"https://api.github.com/users/aviabird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aviabird/subscriptions","organizations_url":"https://api.github.com/users/aviabird/orgs","repos_url":"https://api.github.com/users/aviabird/repos","events_url":"https://api.github.com/users/aviabird/events{/privacy}","received_events_url":"https://api.github.com/users/aviabird/received_events","type":"Organization","site_admin":false},"repo":{"id":121001913,"node_id":"MDEwOlJlcG9zaXRvcnkxMjEwMDE5MTM=","name":"snitch","full_name":"aviabird/snitch","owner":{"login":"aviabird","id":22424801,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyNDI0ODAx","avatar_url":"https://avatars3.githubusercontent.com/u/22424801?v=4","gravatar_id":"","url":"https://api.github.com/users/aviabird","html_url":"https://github.com/aviabird","followers_url":"https://api.github.com/users/aviabird/followers","following_url":"https://api.github.com/users/aviabird/following{/other_user}","gists_url":"https://api.github.com/users/aviabird/gists{/gist_id}","starred_url":"https://api.github.com/users/aviabird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aviabird/subscriptions","organizations_url":"https://api.github.com/users/aviabird/orgs","repos_url":"https://api.github.com/users/aviabird/repos","events_url":"https://api.github.com/users/aviabird/events{/privacy}","received_events_url":"https://api.github.com/users/aviabird/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aviabird/snitch","description":"E-Commerce re-invented in Elixir","fork":false,"url":"https://api.github.com/repos/aviabird/snitch","forks_url":"https://api.github.com/repos/aviabird/snitch/forks","keys_url":"https://api.github.com/repos/aviabird/snitch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aviabird/snitch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aviabird/snitch/teams","hooks_url":"https://api.github.com/repos/aviabird/snitch/hooks","issue_events_url":"https://api.github.com/repos/aviabird/snitch/issues/events{/number}","events_url":"https://api.github.com/repos/aviabird/snitch/events","assignees_url":"https://api.github.com/repos/aviabird/snitch/assignees{/user}","branches_url":"https://api.github.com/repos/aviabird/snitch/branches{/branch}","tags_url":"https://api.github.com/repos/aviabird/snitch/tags","blobs_url":"https://api.github.com/repos/aviabird/snitch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aviabird/snitch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aviabird/snitch/git/refs{/sha}","trees_url":"https://api.github.com/repos/aviabird/snitch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aviabird/snitch/statuses/{sha}","languages_url":"https://api.github.com/repos/aviabird/snitch/languages","stargazers_url":"https://api.github.com/repos/aviabird/snitch/stargazers","contributors_url":"https://api.github.com/repos/aviabird/snitch/contributors","subscribers_url":"https://api.github.com/repos/aviabird/snitch/subscribers","subscription_url":"https://api.github.com/repos/aviabird/snitch/subscription","commits_url":"https://api.github.com/repos/aviabird/snitch/commits{/sha}","git_commits_url":"https://api.github.com/repos/aviabird/snitch/git/commits{/sha}","comments_url":"https://api.github.com/repos/aviabird/snitch/comments{/number}","issue_comment_url":"https://api.github.com/repos/aviabird/snitch/issues/comments{/number}","contents_url":"https://api.github.com/repos/aviabird/snitch/contents/{+path}","compare_url":"https://api.github.com/repos/aviabird/snitch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aviabird/snitch/merges","archive_url":"https://api.github.com/repos/aviabird/snitch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aviabird/snitch/downloads","issues_url":"https://api.github.com/repos/aviabird/snitch/issues{/number}","pulls_url":"https://api.github.com/repos/aviabird/snitch/pulls{/number}","milestones_url":"https://api.github.com/repos/aviabird/snitch/milestones{/number}","notifications_url":"https://api.github.com/repos/aviabird/snitch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aviabird/snitch/labels{/name}","releases_url":"https://api.github.com/repos/aviabird/snitch/releases{/id}","deployments_url":"https://api.github.com/repos/aviabird/snitch/deployments","created_at":"2018-02-10T09:24:32Z","updated_at":"2018-07-18T09:32:47Z","pushed_at":"2018-07-18T12:04:37Z","git_url":"git://github.com/aviabird/snitch.git","ssh_url":"git@github.com:aviabird/snitch.git","clone_url":"https://github.com/aviabird/snitch.git","svn_url":"https://github.com/aviabird/snitch","homepage":"","size":998,"stargazers_count":15,"watchers_count":15,"language":"Elixir","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":30,"license":null,"forks":7,"open_issues":30,"watchers":15,"default_branch":"develop"}},"base":{"label":"aviabird:develop","ref":"develop","sha":"59ff1978cb6eb9334ee5a0d4f14b5537053ae80c","user":{"login":"aviabird","id":22424801,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyNDI0ODAx","avatar_url":"https://avatars3.githubusercontent.com/u/22424801?v=4","gravatar_id":"","url":"https://api.github.com/users/aviabird","html_url":"https://github.com/aviabird","followers_url":"https://api.github.com/users/aviabird/followers","following_url":"https://api.github.com/users/aviabird/following{/other_user}","gists_url":"https://api.github.com/users/aviabird/gists{/gist_id}","starred_url":"https://api.github.com/users/aviabird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aviabird/subscriptions","organizations_url":"https://api.github.com/users/aviabird/orgs","repos_url":"https://api.github.com/users/aviabird/repos","events_url":"https://api.github.com/users/aviabird/events{/privacy}","received_events_url":"https://api.github.com/users/aviabird/received_events","type":"Organization","site_admin":false},"repo":{"id":121001913,"node_id":"MDEwOlJlcG9zaXRvcnkxMjEwMDE5MTM=","name":"snitch","full_name":"aviabird/snitch","owner":{"login":"aviabird","id":22424801,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyNDI0ODAx","avatar_url":"https://avatars3.githubusercontent.com/u/22424801?v=4","gravatar_id":"","url":"https://api.github.com/users/aviabird","html_url":"https://github.com/aviabird","followers_url":"https://api.github.com/users/aviabird/followers","following_url":"https://api.github.com/users/aviabird/following{/other_user}","gists_url":"https://api.github.com/users/aviabird/gists{/gist_id}","starred_url":"https://api.github.com/users/aviabird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aviabird/subscriptions","organizations_url":"https://api.github.com/users/aviabird/orgs","repos_url":"https://api.github.com/users/aviabird/repos","events_url":"https://api.github.com/users/aviabird/events{/privacy}","received_events_url":"https://api.github.com/users/aviabird/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aviabird/snitch","description":"E-Commerce re-invented in Elixir","fork":false,"url":"https://api.github.com/repos/aviabird/snitch","forks_url":"https://api.github.com/repos/aviabird/snitch/forks","keys_url":"https://api.github.com/repos/aviabird/snitch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aviabird/snitch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aviabird/snitch/teams","hooks_url":"https://api.github.com/repos/aviabird/snitch/hooks","issue_events_url":"https://api.github.com/repos/aviabird/snitch/issues/events{/number}","events_url":"https://api.github.com/repos/aviabird/snitch/events","assignees_url":"https://api.github.com/repos/aviabird/snitch/assignees{/user}","branches_url":"https://api.github.com/repos/aviabird/snitch/branches{/branch}","tags_url":"https://api.github.com/repos/aviabird/snitch/tags","blobs_url":"https://api.github.com/repos/aviabird/snitch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aviabird/snitch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aviabird/snitch/git/refs{/sha}","trees_url":"https://api.github.com/repos/aviabird/snitch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aviabird/snitch/statuses/{sha}","languages_url":"https://api.github.com/repos/aviabird/snitch/languages","stargazers_url":"https://api.github.com/repos/aviabird/snitch/stargazers","contributors_url":"https://api.github.com/repos/aviabird/snitch/contributors","subscribers_url":"https://api.github.com/repos/aviabird/snitch/subscribers","subscription_url":"https://api.github.com/repos/aviabird/snitch/subscription","commits_url":"https://api.github.com/repos/aviabird/snitch/commits{/sha}","git_commits_url":"https://api.github.com/repos/aviabird/snitch/git/commits{/sha}","comments_url":"https://api.github.com/repos/aviabird/snitch/comments{/number}","issue_comment_url":"https://api.github.com/repos/aviabird/snitch/issues/comments{/number}","contents_url":"https://api.github.com/repos/aviabird/snitch/contents/{+path}","compare_url":"https://api.github.com/repos/aviabird/snitch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aviabird/snitch/merges","archive_url":"https://api.github.com/repos/aviabird/snitch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aviabird/snitch/downloads","issues_url":"https://api.github.com/repos/aviabird/snitch/issues{/number}","pulls_url":"https://api.github.com/repos/aviabird/snitch/pulls{/number}","milestones_url":"https://api.github.com/repos/aviabird/snitch/milestones{/number}","notifications_url":"https://api.github.com/repos/aviabird/snitch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aviabird/snitch/labels{/name}","releases_url":"https://api.github.com/repos/aviabird/snitch/releases{/id}","deployments_url":"https://api.github.com/repos/aviabird/snitch/deployments","created_at":"2018-02-10T09:24:32Z","updated_at":"2018-07-18T09:32:47Z","pushed_at":"2018-07-18T12:04:37Z","git_url":"git://github.com/aviabird/snitch.git","ssh_url":"git@github.com:aviabird/snitch.git","clone_url":"https://github.com/aviabird/snitch.git","svn_url":"https://github.com/aviabird/snitch","homepage":"","size":998,"stargazers_count":15,"watchers_count":15,"language":"Elixir","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":30,"license":null,"forks":7,"open_issues":30,"watchers":15,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/aviabird/snitch/pulls/147"},"html":{"href":"https://github.com/aviabird/snitch/pull/147"},"issue":{"href":"https://api.github.com/repos/aviabird/snitch/issues/147"},"comments":{"href":"https://api.github.com/repos/aviabird/snitch/issues/147/comments"},"review_comments":{"href":"https://api.github.com/repos/aviabird/snitch/pulls/147/comments"},"review_comment":{"href":"https://api.github.com/repos/aviabird/snitch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aviabird/snitch/pulls/147/commits"},"statuses":{"href":"https://api.github.com/repos/aviabird/snitch/statuses/4f30d2579cb027b4052bde8f01b4954fce762808"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"pkrawat1"}}