{"action":"created","comment":{"url":"https://api.github.com/repos/Jeiwan/TravellerNG/pulls/comments/44245708","id":44245708,"diff_hunk":"@@ -0,0 +1,306 @@\n+describe('AdminHotelsController', () => {\n+  var AdminHotelsController,\n+      $rootScope;\n+\n+  var fakeHotels = [\n+    {\n+      place: { objectId: '1' },\n+      objectId: '1',\n+      title: 'Fake Hotel',\n+      stars: 5\n+    },\n+    {\n+      place: { objectId: '2' },\n+      objectId: '2',\n+      title: 'Fake Hotel 2',\n+      stars: 3\n+    }\n+  ];\n+  fakeHotels.forEach((fakeHotel) => {\n+    angular.extend(fakeHotel, {\n+      state: 'show',\n+      edit() {\n+        this.state = 'edit';\n+      },\n+      show() {\n+        this.state = 'show';\n+      },\n+      isShown() {\n+        return this.state === 'show';\n+      },\n+      isEdited() {\n+        return this.state === 'edit';\n+      }\n+    });\n+  });\n+\n+  var fakePlaces = [\n+    {\n+      country: { objectId: '1' },\n+      objectId: '1',\n+      name: 'Fake Place'\n+    },\n+    {\n+      country: { objectId: '2' },\n+      objectId: '2',\n+      name: 'Fake Place 2'\n+    },\n+    {\n+      country: { objectId: '3' },\n+      objectId: '3',\n+      name: 'Fake Place 3'\n+    }\n+  ];\n+\n+  var newHotel = {\n+    place: { objectId: '3' },\n+    objectId: '3',\n+    title: 'New Fake Hotel',\n+    stars: 4\n+  };\n+\n+  beforeEach(window.module('TravellerNG'));\n+\n+  beforeEach(inject(($controller, $q, _$rootScope_) => {\n+    var fakeHotelsService = {\n+      query: () => {\n+        var d = $q.defer();\n+        d.resolve(angular.copy(fakeHotels));\n+        return {$promise: d.promise};\n+      },\n+      create: () => {\n+        var d = $q.defer();\n+        d.resolve({objectId: newHotel.objectId, createdAt: (new Date()).toISOString()});\n+        return {$promise: d.promise};","path":"src/app/admin/hotels/admin_hotels.controller.spec.js","position":74,"original_position":74,"commit_id":"58b7fea76fc2e9bd0e8e5f246be0c88a886ffb44","original_commit_id":"58b7fea76fc2e9bd0e8e5f246be0c88a886ffb44","user":{"login":"anaumov","id":1510570,"avatar_url":"https://avatars.githubusercontent.com/u/1510570?v=3","gravatar_id":"","url":"https://api.github.com/users/anaumov","html_url":"https://github.com/anaumov","followers_url":"https://api.github.com/users/anaumov/followers","following_url":"https://api.github.com/users/anaumov/following{/other_user}","gists_url":"https://api.github.com/users/anaumov/gists{/gist_id}","starred_url":"https://api.github.com/users/anaumov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anaumov/subscriptions","organizations_url":"https://api.github.com/users/anaumov/orgs","repos_url":"https://api.github.com/users/anaumov/repos","events_url":"https://api.github.com/users/anaumov/events{/privacy}","received_events_url":"https://api.github.com/users/anaumov/received_events","type":"User","site_admin":false},"body":"Вынеси блок в хелпер функцию\r\n```\r\nfunction testPromise() {\r\n  var d = $q.defer();\r\n  d.resolve(resolvedData);\r\n  return {$promise: d.promise};\r\n}\r\n\r\ntestPromise({objectId: newHotel.objectId, createdAt: (new Date()).toISOString()})","created_at":"2015-11-09T07:03:25Z","updated_at":"2015-11-09T07:03:25Z","html_url":"https://github.com/Jeiwan/TravellerNG/pull/5#discussion_r44245708","pull_request_url":"https://api.github.com/repos/Jeiwan/TravellerNG/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/Jeiwan/TravellerNG/pulls/comments/44245708"},"html":{"href":"https://github.com/Jeiwan/TravellerNG/pull/5#discussion_r44245708"},"pull_request":{"href":"https://api.github.com/repos/Jeiwan/TravellerNG/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/Jeiwan/TravellerNG/pulls/5","id":50052975,"html_url":"https://github.com/Jeiwan/TravellerNG/pull/5","diff_url":"https://github.com/Jeiwan/TravellerNG/pull/5.diff","patch_url":"https://github.com/Jeiwan/TravellerNG/pull/5.patch","issue_url":"https://api.github.com/repos/Jeiwan/TravellerNG/issues/5","number":5,"state":"open","locked":false,"title":"Lesson 5","user":{"login":"Jeiwan","id":8029346,"avatar_url":"https://avatars.githubusercontent.com/u/8029346?v=3","gravatar_id":"","url":"https://api.github.com/users/Jeiwan","html_url":"https://github.com/Jeiwan","followers_url":"https://api.github.com/users/Jeiwan/followers","following_url":"https://api.github.com/users/Jeiwan/following{/other_user}","gists_url":"https://api.github.com/users/Jeiwan/gists{/gist_id}","starred_url":"https://api.github.com/users/Jeiwan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jeiwan/subscriptions","organizations_url":"https://api.github.com/users/Jeiwan/orgs","repos_url":"https://api.github.com/users/Jeiwan/repos","events_url":"https://api.github.com/users/Jeiwan/events{/privacy}","received_events_url":"https://api.github.com/users/Jeiwan/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-08T04:48:08Z","updated_at":"2015-11-09T07:03:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e21129bd96845f6f6d2954b202b9d9a0e36848cc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Jeiwan/TravellerNG/pulls/5/commits","review_comments_url":"https://api.github.com/repos/Jeiwan/TravellerNG/pulls/5/comments","review_comment_url":"https://api.github.com/repos/Jeiwan/TravellerNG/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Jeiwan/TravellerNG/issues/5/comments","statuses_url":"https://api.github.com/repos/Jeiwan/TravellerNG/statuses/58b7fea76fc2e9bd0e8e5f246be0c88a886ffb44","head":{"label":"Jeiwan:lesson5","ref":"lesson5","sha":"58b7fea76fc2e9bd0e8e5f246be0c88a886ffb44","user":{"login":"Jeiwan","id":8029346,"avatar_url":"https://avatars.githubusercontent.com/u/8029346?v=3","gravatar_id":"","url":"https://api.github.com/users/Jeiwan","html_url":"https://github.com/Jeiwan","followers_url":"https://api.github.com/users/Jeiwan/followers","following_url":"https://api.github.com/users/Jeiwan/following{/other_user}","gists_url":"https://api.github.com/users/Jeiwan/gists{/gist_id}","starred_url":"https://api.github.com/users/Jeiwan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jeiwan/subscriptions","organizations_url":"https://api.github.com/users/Jeiwan/orgs","repos_url":"https://api.github.com/users/Jeiwan/repos","events_url":"https://api.github.com/users/Jeiwan/events{/privacy}","received_events_url":"https://api.github.com/users/Jeiwan/received_events","type":"User","site_admin":false},"repo":{"id":44045359,"name":"TravellerNG","full_name":"Jeiwan/TravellerNG","owner":{"login":"Jeiwan","id":8029346,"avatar_url":"https://avatars.githubusercontent.com/u/8029346?v=3","gravatar_id":"","url":"https://api.github.com/users/Jeiwan","html_url":"https://github.com/Jeiwan","followers_url":"https://api.github.com/users/Jeiwan/followers","following_url":"https://api.github.com/users/Jeiwan/following{/other_user}","gists_url":"https://api.github.com/users/Jeiwan/gists{/gist_id}","starred_url":"https://api.github.com/users/Jeiwan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jeiwan/subscriptions","organizations_url":"https://api.github.com/users/Jeiwan/orgs","repos_url":"https://api.github.com/users/Jeiwan/repos","events_url":"https://api.github.com/users/Jeiwan/events{/privacy}","received_events_url":"https://api.github.com/users/Jeiwan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Jeiwan/TravellerNG","description":"The best trips in the world for your pleasure","fork":false,"url":"https://api.github.com/repos/Jeiwan/TravellerNG","forks_url":"https://api.github.com/repos/Jeiwan/TravellerNG/forks","keys_url":"https://api.github.com/repos/Jeiwan/TravellerNG/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Jeiwan/TravellerNG/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Jeiwan/TravellerNG/teams","hooks_url":"https://api.github.com/repos/Jeiwan/TravellerNG/hooks","issue_events_url":"https://api.github.com/repos/Jeiwan/TravellerNG/issues/events{/number}","events_url":"https://api.github.com/repos/Jeiwan/TravellerNG/events","assignees_url":"https://api.github.com/repos/Jeiwan/TravellerNG/assignees{/user}","branches_url":"https://api.github.com/repos/Jeiwan/TravellerNG/branches{/branch}","tags_url":"https://api.github.com/repos/Jeiwan/TravellerNG/tags","blobs_url":"https://api.github.com/repos/Jeiwan/TravellerNG/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Jeiwan/TravellerNG/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Jeiwan/TravellerNG/git/refs{/sha}","trees_url":"https://api.github.com/repos/Jeiwan/TravellerNG/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Jeiwan/TravellerNG/statuses/{sha}","languages_url":"https://api.github.com/repos/Jeiwan/TravellerNG/languages","stargazers_url":"https://api.github.com/repos/Jeiwan/TravellerNG/stargazers","contributors_url":"https://api.github.com/repos/Jeiwan/TravellerNG/contributors","subscribers_url":"https://api.github.com/repos/Jeiwan/TravellerNG/subscribers","subscription_url":"https://api.github.com/repos/Jeiwan/TravellerNG/subscription","commits_url":"https://api.github.com/repos/Jeiwan/TravellerNG/commits{/sha}","git_commits_url":"https://api.github.com/repos/Jeiwan/TravellerNG/git/commits{/sha}","comments_url":"https://api.github.com/repos/Jeiwan/TravellerNG/comments{/number}","issue_comment_url":"https://api.github.com/repos/Jeiwan/TravellerNG/issues/comments{/number}","contents_url":"https://api.github.com/repos/Jeiwan/TravellerNG/contents/{+path}","compare_url":"https://api.github.com/repos/Jeiwan/TravellerNG/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Jeiwan/TravellerNG/merges","archive_url":"https://api.github.com/repos/Jeiwan/TravellerNG/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Jeiwan/TravellerNG/downloads","issues_url":"https://api.github.com/repos/Jeiwan/TravellerNG/issues{/number}","pulls_url":"https://api.github.com/repos/Jeiwan/TravellerNG/pulls{/number}","milestones_url":"https://api.github.com/repos/Jeiwan/TravellerNG/milestones{/number}","notifications_url":"https://api.github.com/repos/Jeiwan/TravellerNG/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Jeiwan/TravellerNG/labels{/name}","releases_url":"https://api.github.com/repos/Jeiwan/TravellerNG/releases{/id}","created_at":"2015-10-11T08:55:14Z","updated_at":"2015-10-11T16:50:08Z","pushed_at":"2015-11-09T06:16:43Z","git_url":"git://github.com/Jeiwan/TravellerNG.git","ssh_url":"git@github.com:Jeiwan/TravellerNG.git","clone_url":"https://github.com/Jeiwan/TravellerNG.git","svn_url":"https://github.com/Jeiwan/TravellerNG","homepage":null,"size":416,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"Jeiwan:master","ref":"master","sha":"8e22374eaf4de911e1948a2e8a27a9317ddf7fbe","user":{"login":"Jeiwan","id":8029346,"avatar_url":"https://avatars.githubusercontent.com/u/8029346?v=3","gravatar_id":"","url":"https://api.github.com/users/Jeiwan","html_url":"https://github.com/Jeiwan","followers_url":"https://api.github.com/users/Jeiwan/followers","following_url":"https://api.github.com/users/Jeiwan/following{/other_user}","gists_url":"https://api.github.com/users/Jeiwan/gists{/gist_id}","starred_url":"https://api.github.com/users/Jeiwan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jeiwan/subscriptions","organizations_url":"https://api.github.com/users/Jeiwan/orgs","repos_url":"https://api.github.com/users/Jeiwan/repos","events_url":"https://api.github.com/users/Jeiwan/events{/privacy}","received_events_url":"https://api.github.com/users/Jeiwan/received_events","type":"User","site_admin":false},"repo":{"id":44045359,"name":"TravellerNG","full_name":"Jeiwan/TravellerNG","owner":{"login":"Jeiwan","id":8029346,"avatar_url":"https://avatars.githubusercontent.com/u/8029346?v=3","gravatar_id":"","url":"https://api.github.com/users/Jeiwan","html_url":"https://github.com/Jeiwan","followers_url":"https://api.github.com/users/Jeiwan/followers","following_url":"https://api.github.com/users/Jeiwan/following{/other_user}","gists_url":"https://api.github.com/users/Jeiwan/gists{/gist_id}","starred_url":"https://api.github.com/users/Jeiwan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jeiwan/subscriptions","organizations_url":"https://api.github.com/users/Jeiwan/orgs","repos_url":"https://api.github.com/users/Jeiwan/repos","events_url":"https://api.github.com/users/Jeiwan/events{/privacy}","received_events_url":"https://api.github.com/users/Jeiwan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Jeiwan/TravellerNG","description":"The best trips in the world for your pleasure","fork":false,"url":"https://api.github.com/repos/Jeiwan/TravellerNG","forks_url":"https://api.github.com/repos/Jeiwan/TravellerNG/forks","keys_url":"https://api.github.com/repos/Jeiwan/TravellerNG/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Jeiwan/TravellerNG/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Jeiwan/TravellerNG/teams","hooks_url":"https://api.github.com/repos/Jeiwan/TravellerNG/hooks","issue_events_url":"https://api.github.com/repos/Jeiwan/TravellerNG/issues/events{/number}","events_url":"https://api.github.com/repos/Jeiwan/TravellerNG/events","assignees_url":"https://api.github.com/repos/Jeiwan/TravellerNG/assignees{/user}","branches_url":"https://api.github.com/repos/Jeiwan/TravellerNG/branches{/branch}","tags_url":"https://api.github.com/repos/Jeiwan/TravellerNG/tags","blobs_url":"https://api.github.com/repos/Jeiwan/TravellerNG/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Jeiwan/TravellerNG/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Jeiwan/TravellerNG/git/refs{/sha}","trees_url":"https://api.github.com/repos/Jeiwan/TravellerNG/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Jeiwan/TravellerNG/statuses/{sha}","languages_url":"https://api.github.com/repos/Jeiwan/TravellerNG/languages","stargazers_url":"https://api.github.com/repos/Jeiwan/TravellerNG/stargazers","contributors_url":"https://api.github.com/repos/Jeiwan/TravellerNG/contributors","subscribers_url":"https://api.github.com/repos/Jeiwan/TravellerNG/subscribers","subscription_url":"https://api.github.com/repos/Jeiwan/TravellerNG/subscription","commits_url":"https://api.github.com/repos/Jeiwan/TravellerNG/commits{/sha}","git_commits_url":"https://api.github.com/repos/Jeiwan/TravellerNG/git/commits{/sha}","comments_url":"https://api.github.com/repos/Jeiwan/TravellerNG/comments{/number}","issue_comment_url":"https://api.github.com/repos/Jeiwan/TravellerNG/issues/comments{/number}","contents_url":"https://api.github.com/repos/Jeiwan/TravellerNG/contents/{+path}","compare_url":"https://api.github.com/repos/Jeiwan/TravellerNG/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Jeiwan/TravellerNG/merges","archive_url":"https://api.github.com/repos/Jeiwan/TravellerNG/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Jeiwan/TravellerNG/downloads","issues_url":"https://api.github.com/repos/Jeiwan/TravellerNG/issues{/number}","pulls_url":"https://api.github.com/repos/Jeiwan/TravellerNG/pulls{/number}","milestones_url":"https://api.github.com/repos/Jeiwan/TravellerNG/milestones{/number}","notifications_url":"https://api.github.com/repos/Jeiwan/TravellerNG/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Jeiwan/TravellerNG/labels{/name}","releases_url":"https://api.github.com/repos/Jeiwan/TravellerNG/releases{/id}","created_at":"2015-10-11T08:55:14Z","updated_at":"2015-10-11T16:50:08Z","pushed_at":"2015-11-09T06:16:43Z","git_url":"git://github.com/Jeiwan/TravellerNG.git","ssh_url":"git@github.com:Jeiwan/TravellerNG.git","clone_url":"https://github.com/Jeiwan/TravellerNG.git","svn_url":"https://github.com/Jeiwan/TravellerNG","homepage":null,"size":416,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Jeiwan/TravellerNG/pulls/5"},"html":{"href":"https://github.com/Jeiwan/TravellerNG/pull/5"},"issue":{"href":"https://api.github.com/repos/Jeiwan/TravellerNG/issues/5"},"comments":{"href":"https://api.github.com/repos/Jeiwan/TravellerNG/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/Jeiwan/TravellerNG/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/Jeiwan/TravellerNG/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Jeiwan/TravellerNG/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/Jeiwan/TravellerNG/statuses/58b7fea76fc2e9bd0e8e5f246be0c88a886ffb44"}}}}