{"action":"created","comment":{"url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls/comments/93375038","pull_request_review_id":13900269,"id":93375038,"diff_hunk":"@@ -0,0 +1,93 @@\n+require 'rails_helper'\n+\n+RSpec.describe MyAnimeListSyncService do\n+  let(:library_entry) do\n+    build(:library_entry,\n+      status: 'current',\n+      progress: 10)\n+  end\n+\n+  let(:linked_profile) do\n+    build(:linked_profile,\n+      url: 'myanimelist',\n+      external_user_id: 'toyhammered',\n+      token: 'fakefake')\n+  end\n+\n+  let(:mapping) do\n+    build(:mapping,\n+      external_site: 'myanimelist',\n+      external_id: 11_633)\n+  end\n+\n+  # delete or create/update\n+  subject { described_class.new(library_entry, 'create/update') }\n+\n+  before do\n+    host = described_class::ATARASHII_API_HOST\n+    mine = '?mine=1'\n+\n+    # Blood Lad, this is on my list\n+    # authorized\n+    stub_request(:get, \"#{host}anime/11633#{mine}\")\n+      .to_return(body: fixture('my_anime_list/sync/anime/blood-lad.json'))\n+\n+    # Boku no Pico, this is NOT on my list\n+    # authorized\n+    stub_request(:get, \"#{host}anime/1639#{mine}\")\n+      .to_return(body: fixture('my_anime_list/sync/anime/boku-no-pico.json'))\n+\n+    # Toy's anime list (slimmed down)\n+    # not authorized\n+    stub_request(:get, \"#{host}animelist/toyhammered\")\n+      .to_return(body: fixture('my_anime_list/sync/anime/toy-anime-list.json'))\n+\n+    # PUT request\n+    stub_request(:put, \"#{host}animelist/anime/11633\")\n+      .with(\n+        body: 'episodes=10&rewatch_count=0&score&status=1',\n+        headers: {\n+          Authorization: 'Basic dG95aGFtbWVyZWQ6ZmFrZWZha2U='\n+        })\n+      .to_return(status: 200)\n+\n+    # POST request\n+    stub_request(:post, \"#{host}animelist/anime\")\n+      .with(\n+        body: 'anime_id=11633&episodes=10&score&status=1',\n+        headers: {\n+          Authorization: 'Basic dG95aGFtbWVyZWQ6ZmFrZWZha2U='\n+        })\n+      .to_return(status: 200)\n+  end\n+\n+  context 'Anime' do\n+  end\n+\n+  context 'Manga' do\n+  end\n+\n+  context 'Tyhpoeus Requests' do\n+    describe '#get' do\n+      # it 'should issue a request to the server' do\n+      #   stub_request(:get, 'example.com', linked_profile).to_return(body: 'HI')","path":"spec/services/my_anime_list_sync_service_spec.rb","position":73,"original_position":73,"commit_id":"2cfea9ebbf7d4266ca210cd9e692ead2c7c864bb","original_commit_id":"2cfea9ebbf7d4266ca210cd9e692ead2c7c864bb","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. [81/80] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)","created_at":"2016-12-21T04:49:49Z","updated_at":"2016-12-21T04:49:49Z","html_url":"https://github.com/hummingbird-me/hummingbird-server/pull/25#discussion_r93375038","pull_request_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls/25","_links":{"self":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls/comments/93375038"},"html":{"href":"https://github.com/hummingbird-me/hummingbird-server/pull/25#discussion_r93375038"},"pull_request":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls/25","id":98484674,"html_url":"https://github.com/hummingbird-me/hummingbird-server/pull/25","diff_url":"https://github.com/hummingbird-me/hummingbird-server/pull/25.diff","patch_url":"https://github.com/hummingbird-me/hummingbird-server/pull/25.patch","issue_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/issues/25","number":25,"state":"open","locked":false,"title":"Mal Auto Updates","user":{"login":"toyhammered","id":1283983,"avatar_url":"https://avatars.githubusercontent.com/u/1283983?v=3","gravatar_id":"","url":"https://api.github.com/users/toyhammered","html_url":"https://github.com/toyhammered","followers_url":"https://api.github.com/users/toyhammered/followers","following_url":"https://api.github.com/users/toyhammered/following{/other_user}","gists_url":"https://api.github.com/users/toyhammered/gists{/gist_id}","starred_url":"https://api.github.com/users/toyhammered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toyhammered/subscriptions","organizations_url":"https://api.github.com/users/toyhammered/orgs","repos_url":"https://api.github.com/users/toyhammered/repos","events_url":"https://api.github.com/users/toyhammered/events{/privacy}","received_events_url":"https://api.github.com/users/toyhammered/received_events","type":"User","site_admin":false},"body":"**Feature:** Kitsu will update your mal list so it is in sync with Kitsu at all times\r\n\r\n~~**[x]** - when a user updates a library entry it will update mal list also~~\r\n**[WIP]** - when a user initially syncs their account (inputting username/password) we will completely sync    up their mal list to be the same as kitsu list\r\n  ~~- [x] will create/update all entries~~\r\n    - [] will delete any entries on mal list and not on kitsu list\r\n**[WIP]** - write behavior tests for `get, delete, post` methods\r\n**[WIP]** - make sure this works with anime and manga\r\n  ~~- **[x]** anime~~\r\n    - **[WIP]** manga\r\n","created_at":"2016-12-18T19:37:25Z","updated_at":"2016-12-21T04:49:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2218e2c29ccb807e1f46bec060fb782bf4f14e28","assignee":{"login":"toyhammered","id":1283983,"avatar_url":"https://avatars.githubusercontent.com/u/1283983?v=3","gravatar_id":"","url":"https://api.github.com/users/toyhammered","html_url":"https://github.com/toyhammered","followers_url":"https://api.github.com/users/toyhammered/followers","following_url":"https://api.github.com/users/toyhammered/following{/other_user}","gists_url":"https://api.github.com/users/toyhammered/gists{/gist_id}","starred_url":"https://api.github.com/users/toyhammered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toyhammered/subscriptions","organizations_url":"https://api.github.com/users/toyhammered/orgs","repos_url":"https://api.github.com/users/toyhammered/repos","events_url":"https://api.github.com/users/toyhammered/events{/privacy}","received_events_url":"https://api.github.com/users/toyhammered/received_events","type":"User","site_admin":false},"assignees":[{"login":"toyhammered","id":1283983,"avatar_url":"https://avatars.githubusercontent.com/u/1283983?v=3","gravatar_id":"","url":"https://api.github.com/users/toyhammered","html_url":"https://github.com/toyhammered","followers_url":"https://api.github.com/users/toyhammered/followers","following_url":"https://api.github.com/users/toyhammered/following{/other_user}","gists_url":"https://api.github.com/users/toyhammered/gists{/gist_id}","starred_url":"https://api.github.com/users/toyhammered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toyhammered/subscriptions","organizations_url":"https://api.github.com/users/toyhammered/orgs","repos_url":"https://api.github.com/users/toyhammered/repos","events_url":"https://api.github.com/users/toyhammered/events{/privacy}","received_events_url":"https://api.github.com/users/toyhammered/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls/25/commits","review_comments_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls/25/comments","review_comment_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/issues/25/comments","statuses_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/statuses/2cfea9ebbf7d4266ca210cd9e692ead2c7c864bb","head":{"label":"toyhammered:mal-auto-updates","ref":"mal-auto-updates","sha":"2cfea9ebbf7d4266ca210cd9e692ead2c7c864bb","user":{"login":"toyhammered","id":1283983,"avatar_url":"https://avatars.githubusercontent.com/u/1283983?v=3","gravatar_id":"","url":"https://api.github.com/users/toyhammered","html_url":"https://github.com/toyhammered","followers_url":"https://api.github.com/users/toyhammered/followers","following_url":"https://api.github.com/users/toyhammered/following{/other_user}","gists_url":"https://api.github.com/users/toyhammered/gists{/gist_id}","starred_url":"https://api.github.com/users/toyhammered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toyhammered/subscriptions","organizations_url":"https://api.github.com/users/toyhammered/orgs","repos_url":"https://api.github.com/users/toyhammered/repos","events_url":"https://api.github.com/users/toyhammered/events{/privacy}","received_events_url":"https://api.github.com/users/toyhammered/received_events","type":"User","site_admin":false},"repo":{"id":70123540,"name":"hummingbird-server","full_name":"toyhammered/hummingbird-server","owner":{"login":"toyhammered","id":1283983,"avatar_url":"https://avatars.githubusercontent.com/u/1283983?v=3","gravatar_id":"","url":"https://api.github.com/users/toyhammered","html_url":"https://github.com/toyhammered","followers_url":"https://api.github.com/users/toyhammered/followers","following_url":"https://api.github.com/users/toyhammered/following{/other_user}","gists_url":"https://api.github.com/users/toyhammered/gists{/gist_id}","starred_url":"https://api.github.com/users/toyhammered/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toyhammered/subscriptions","organizations_url":"https://api.github.com/users/toyhammered/orgs","repos_url":"https://api.github.com/users/toyhammered/repos","events_url":"https://api.github.com/users/toyhammered/events{/privacy}","received_events_url":"https://api.github.com/users/toyhammered/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/toyhammered/hummingbird-server","description":"Rails API server for Hummingbird.me","fork":true,"url":"https://api.github.com/repos/toyhammered/hummingbird-server","forks_url":"https://api.github.com/repos/toyhammered/hummingbird-server/forks","keys_url":"https://api.github.com/repos/toyhammered/hummingbird-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/toyhammered/hummingbird-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/toyhammered/hummingbird-server/teams","hooks_url":"https://api.github.com/repos/toyhammered/hummingbird-server/hooks","issue_events_url":"https://api.github.com/repos/toyhammered/hummingbird-server/issues/events{/number}","events_url":"https://api.github.com/repos/toyhammered/hummingbird-server/events","assignees_url":"https://api.github.com/repos/toyhammered/hummingbird-server/assignees{/user}","branches_url":"https://api.github.com/repos/toyhammered/hummingbird-server/branches{/branch}","tags_url":"https://api.github.com/repos/toyhammered/hummingbird-server/tags","blobs_url":"https://api.github.com/repos/toyhammered/hummingbird-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/toyhammered/hummingbird-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/toyhammered/hummingbird-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/toyhammered/hummingbird-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/toyhammered/hummingbird-server/statuses/{sha}","languages_url":"https://api.github.com/repos/toyhammered/hummingbird-server/languages","stargazers_url":"https://api.github.com/repos/toyhammered/hummingbird-server/stargazers","contributors_url":"https://api.github.com/repos/toyhammered/hummingbird-server/contributors","subscribers_url":"https://api.github.com/repos/toyhammered/hummingbird-server/subscribers","subscription_url":"https://api.github.com/repos/toyhammered/hummingbird-server/subscription","commits_url":"https://api.github.com/repos/toyhammered/hummingbird-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/toyhammered/hummingbird-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/toyhammered/hummingbird-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/toyhammered/hummingbird-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/toyhammered/hummingbird-server/contents/{+path}","compare_url":"https://api.github.com/repos/toyhammered/hummingbird-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/toyhammered/hummingbird-server/merges","archive_url":"https://api.github.com/repos/toyhammered/hummingbird-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/toyhammered/hummingbird-server/downloads","issues_url":"https://api.github.com/repos/toyhammered/hummingbird-server/issues{/number}","pulls_url":"https://api.github.com/repos/toyhammered/hummingbird-server/pulls{/number}","milestones_url":"https://api.github.com/repos/toyhammered/hummingbird-server/milestones{/number}","notifications_url":"https://api.github.com/repos/toyhammered/hummingbird-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/toyhammered/hummingbird-server/labels{/name}","releases_url":"https://api.github.com/repos/toyhammered/hummingbird-server/releases{/id}","deployments_url":"https://api.github.com/repos/toyhammered/hummingbird-server/deployments","created_at":"2016-10-06T04:46:43Z","updated_at":"2016-10-06T04:46:44Z","pushed_at":"2016-12-21T04:49:39Z","git_url":"git://github.com/toyhammered/hummingbird-server.git","ssh_url":"git@github.com:toyhammered/hummingbird-server.git","clone_url":"https://github.com/toyhammered/hummingbird-server.git","svn_url":"https://github.com/toyhammered/hummingbird-server","homepage":null,"size":1665,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"the-future"}},"base":{"label":"hummingbird-me:the-future","ref":"the-future","sha":"ab9ed3ec83e16c4e2fdec9d61d7822ccafa8ed9e","user":{"login":"hummingbird-me","id":7648832,"avatar_url":"https://avatars.githubusercontent.com/u/7648832?v=3","gravatar_id":"","url":"https://api.github.com/users/hummingbird-me","html_url":"https://github.com/hummingbird-me","followers_url":"https://api.github.com/users/hummingbird-me/followers","following_url":"https://api.github.com/users/hummingbird-me/following{/other_user}","gists_url":"https://api.github.com/users/hummingbird-me/gists{/gist_id}","starred_url":"https://api.github.com/users/hummingbird-me/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hummingbird-me/subscriptions","organizations_url":"https://api.github.com/users/hummingbird-me/orgs","repos_url":"https://api.github.com/users/hummingbird-me/repos","events_url":"https://api.github.com/users/hummingbird-me/events{/privacy}","received_events_url":"https://api.github.com/users/hummingbird-me/received_events","type":"Organization","site_admin":false},"repo":{"id":68339720,"name":"hummingbird-server","full_name":"hummingbird-me/hummingbird-server","owner":{"login":"hummingbird-me","id":7648832,"avatar_url":"https://avatars.githubusercontent.com/u/7648832?v=3","gravatar_id":"","url":"https://api.github.com/users/hummingbird-me","html_url":"https://github.com/hummingbird-me","followers_url":"https://api.github.com/users/hummingbird-me/followers","following_url":"https://api.github.com/users/hummingbird-me/following{/other_user}","gists_url":"https://api.github.com/users/hummingbird-me/gists{/gist_id}","starred_url":"https://api.github.com/users/hummingbird-me/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hummingbird-me/subscriptions","organizations_url":"https://api.github.com/users/hummingbird-me/orgs","repos_url":"https://api.github.com/users/hummingbird-me/repos","events_url":"https://api.github.com/users/hummingbird-me/events{/privacy}","received_events_url":"https://api.github.com/users/hummingbird-me/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hummingbird-me/hummingbird-server","description":":steam_locomotive: Rails API server for Hummingbird.me","fork":false,"url":"https://api.github.com/repos/hummingbird-me/hummingbird-server","forks_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/forks","keys_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/teams","hooks_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/hooks","issue_events_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/issues/events{/number}","events_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/events","assignees_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/assignees{/user}","branches_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/branches{/branch}","tags_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/tags","blobs_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/statuses/{sha}","languages_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/languages","stargazers_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/stargazers","contributors_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/contributors","subscribers_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/subscribers","subscription_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/subscription","commits_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/contents/{+path}","compare_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/merges","archive_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/downloads","issues_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/issues{/number}","pulls_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls{/number}","milestones_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/milestones{/number}","notifications_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/labels{/name}","releases_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/releases{/id}","deployments_url":"https://api.github.com/repos/hummingbird-me/hummingbird-server/deployments","created_at":"2016-09-15T23:36:19Z","updated_at":"2016-12-19T17:57:19Z","pushed_at":"2016-12-21T04:49:40Z","git_url":"git://github.com/hummingbird-me/hummingbird-server.git","ssh_url":"git@github.com:hummingbird-me/hummingbird-server.git","clone_url":"https://github.com/hummingbird-me/hummingbird-server.git","svn_url":"https://github.com/hummingbird-me/hummingbird-server","homepage":"","size":1686,"stargazers_count":19,"watchers_count":19,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":29,"mirror_url":null,"open_issues_count":5,"forks":29,"open_issues":5,"watchers":19,"default_branch":"the-future"}},"_links":{"self":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls/25"},"html":{"href":"https://github.com/hummingbird-me/hummingbird-server/pull/25"},"issue":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird-server/issues/25"},"comments":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird-server/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird-server/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/hummingbird-me/hummingbird-server/statuses/2cfea9ebbf7d4266ca210cd9e692ead2c7c864bb"}}}}
{"actor":{"display_login":"houndci-bot"}}