{"action":"created","comment":{"url":"https://api.github.com/repos/google/ggrc-core/pulls/comments/73496957","id":73496957,"diff_hunk":"@@ -40,4 +40,84 @@ describe('CMS.Controllers.TreeView', function () {\n \n     // test cases here...\n   });\n+\n+  describe('_buildRequestParams() method', function () {\n+    var ctrlInst;\n+    var method;\n+\n+    beforeEach(function () {\n+      ctrlInst = {\n+        options: new can.Map({\n+          parent_instance: {},\n+          model: {},\n+          filter: '',\n+          paging: {\n+            current: 1,\n+            total: null,\n+            pageSize: 10,\n+            count: 6\n+          }\n+        })\n+      };\n+\n+      method = Ctrl.prototype._buildRequestParams.bind(ctrlInst);\n+    });\n+\n+    describe('Assessment related to Audit', function () {\n+      beforeEach(function () {\n+        ctrlInst.options.parent_instance = {\n+          id: 1,\n+          type: 'Audit'\n+        };\n+        ctrlInst.options.model.shortName = 'Assessment';\n+      });\n+\n+      it('return default params for paging request', function () {\n+        var result = method()[0];\n+\n+        expect(result.object_name).toEqual('Assessment');\n+        expect(result.limit).toEqual([0, 10]);\n+        expect(result.filters.expression.object_name).toEqual('Audit');\n+      });\n+\n+      it('return limit for 3rd page', function () {\n+        var result;\n+        ctrlInst.options.paging.current = 3;\n+        ctrlInst.options.paging.pageSize = 50;\n+\n+        result = method()[0];\n+\n+        expect(result.limit).toEqual([100, 150]);","path":"src/ggrc/assets/javascripts/controllers/tests/tree_view_controller_spec.js","position":62,"original_position":62,"commit_id":"2dcddb43bae3dd10ca043b1f1b6d11011d94c67e","original_commit_id":"8484aab997bc8a8dcf28740686a68df5200daf2c","user":{"login":"AlexNo","id":4737102,"avatar_url":"https://avatars.githubusercontent.com/u/4737102?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexNo","html_url":"https://github.com/AlexNo","followers_url":"https://api.github.com/users/AlexNo/followers","following_url":"https://api.github.com/users/AlexNo/following{/other_user}","gists_url":"https://api.github.com/users/AlexNo/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexNo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexNo/subscriptions","organizations_url":"https://api.github.com/users/AlexNo/orgs","repos_url":"https://api.github.com/users/AlexNo/repos","events_url":"https://api.github.com/users/AlexNo/events{/privacy}","received_events_url":"https://api.github.com/users/AlexNo/received_events","type":"User","site_admin":false},"body":"@plamut I've added JSDoc","created_at":"2016-08-04T10:18:45Z","updated_at":"2016-08-04T10:18:45Z","html_url":"https://github.com/google/ggrc-core/pull/4222#discussion_r73496957","pull_request_url":"https://api.github.com/repos/google/ggrc-core/pulls/4222","_links":{"self":{"href":"https://api.github.com/repos/google/ggrc-core/pulls/comments/73496957"},"html":{"href":"https://github.com/google/ggrc-core/pull/4222#discussion_r73496957"},"pull_request":{"href":"https://api.github.com/repos/google/ggrc-core/pulls/4222"}}},"pull_request":{"url":"https://api.github.com/repos/google/ggrc-core/pulls/4222","id":79194877,"html_url":"https://github.com/google/ggrc-core/pull/4222","diff_url":"https://github.com/google/ggrc-core/pull/4222.diff","patch_url":"https://github.com/google/ggrc-core/pull/4222.patch","issue_url":"https://api.github.com/repos/google/ggrc-core/issues/4222","number":4222,"state":"open","locked":false,"title":"FEATURE TreeViewController for use Query API","user":{"login":"AlexNo","id":4737102,"avatar_url":"https://avatars.githubusercontent.com/u/4737102?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexNo","html_url":"https://github.com/AlexNo","followers_url":"https://api.github.com/users/AlexNo/followers","following_url":"https://api.github.com/users/AlexNo/following{/other_user}","gists_url":"https://api.github.com/users/AlexNo/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexNo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexNo/subscriptions","organizations_url":"https://api.github.com/users/AlexNo/orgs","repos_url":"https://api.github.com/users/AlexNo/repos","events_url":"https://api.github.com/users/AlexNo/events{/privacy}","received_events_url":"https://api.github.com/users/AlexNo/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-28T13:24:44Z","updated_at":"2016-08-04T10:18:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"513d4f0ac3122c0dd3c7fe2e100fa69e2762a81b","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/google/ggrc-core/milestones/21","html_url":"https://github.com/google/ggrc-core/milestones/0.9.7-Quince","labels_url":"https://api.github.com/repos/google/ggrc-core/milestones/21/labels","id":1845906,"number":21,"title":"0.9.7-Quince","description":"","creator":{"login":"Smotko","id":513444,"avatar_url":"https://avatars.githubusercontent.com/u/513444?v=3","gravatar_id":"","url":"https://api.github.com/users/Smotko","html_url":"https://github.com/Smotko","followers_url":"https://api.github.com/users/Smotko/followers","following_url":"https://api.github.com/users/Smotko/following{/other_user}","gists_url":"https://api.github.com/users/Smotko/gists{/gist_id}","starred_url":"https://api.github.com/users/Smotko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Smotko/subscriptions","organizations_url":"https://api.github.com/users/Smotko/orgs","repos_url":"https://api.github.com/users/Smotko/repos","events_url":"https://api.github.com/users/Smotko/events{/privacy}","received_events_url":"https://api.github.com/users/Smotko/received_events","type":"User","site_admin":false},"open_issues":15,"closed_issues":174,"state":"open","created_at":"2016-06-23T17:56:25Z","updated_at":"2016-08-03T18:48:11Z","due_on":"2016-08-14T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/google/ggrc-core/pulls/4222/commits","review_comments_url":"https://api.github.com/repos/google/ggrc-core/pulls/4222/comments","review_comment_url":"https://api.github.com/repos/google/ggrc-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/ggrc-core/issues/4222/comments","statuses_url":"https://api.github.com/repos/google/ggrc-core/statuses/2dcddb43bae3dd10ca043b1f1b6d11011d94c67e","head":{"label":"AlexNo:feature-pagination","ref":"feature-pagination","sha":"2dcddb43bae3dd10ca043b1f1b6d11011d94c67e","user":{"login":"AlexNo","id":4737102,"avatar_url":"https://avatars.githubusercontent.com/u/4737102?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexNo","html_url":"https://github.com/AlexNo","followers_url":"https://api.github.com/users/AlexNo/followers","following_url":"https://api.github.com/users/AlexNo/following{/other_user}","gists_url":"https://api.github.com/users/AlexNo/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexNo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexNo/subscriptions","organizations_url":"https://api.github.com/users/AlexNo/orgs","repos_url":"https://api.github.com/users/AlexNo/repos","events_url":"https://api.github.com/users/AlexNo/events{/privacy}","received_events_url":"https://api.github.com/users/AlexNo/received_events","type":"User","site_admin":false},"repo":{"id":59472765,"name":"ggrc-core","full_name":"AlexNo/ggrc-core","owner":{"login":"AlexNo","id":4737102,"avatar_url":"https://avatars.githubusercontent.com/u/4737102?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexNo","html_url":"https://github.com/AlexNo","followers_url":"https://api.github.com/users/AlexNo/followers","following_url":"https://api.github.com/users/AlexNo/following{/other_user}","gists_url":"https://api.github.com/users/AlexNo/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexNo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexNo/subscriptions","organizations_url":"https://api.github.com/users/AlexNo/orgs","repos_url":"https://api.github.com/users/AlexNo/repos","events_url":"https://api.github.com/users/AlexNo/events{/privacy}","received_events_url":"https://api.github.com/users/AlexNo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlexNo/ggrc-core","description":"GGRC Core","fork":true,"url":"https://api.github.com/repos/AlexNo/ggrc-core","forks_url":"https://api.github.com/repos/AlexNo/ggrc-core/forks","keys_url":"https://api.github.com/repos/AlexNo/ggrc-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlexNo/ggrc-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlexNo/ggrc-core/teams","hooks_url":"https://api.github.com/repos/AlexNo/ggrc-core/hooks","issue_events_url":"https://api.github.com/repos/AlexNo/ggrc-core/issues/events{/number}","events_url":"https://api.github.com/repos/AlexNo/ggrc-core/events","assignees_url":"https://api.github.com/repos/AlexNo/ggrc-core/assignees{/user}","branches_url":"https://api.github.com/repos/AlexNo/ggrc-core/branches{/branch}","tags_url":"https://api.github.com/repos/AlexNo/ggrc-core/tags","blobs_url":"https://api.github.com/repos/AlexNo/ggrc-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlexNo/ggrc-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlexNo/ggrc-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlexNo/ggrc-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlexNo/ggrc-core/statuses/{sha}","languages_url":"https://api.github.com/repos/AlexNo/ggrc-core/languages","stargazers_url":"https://api.github.com/repos/AlexNo/ggrc-core/stargazers","contributors_url":"https://api.github.com/repos/AlexNo/ggrc-core/contributors","subscribers_url":"https://api.github.com/repos/AlexNo/ggrc-core/subscribers","subscription_url":"https://api.github.com/repos/AlexNo/ggrc-core/subscription","commits_url":"https://api.github.com/repos/AlexNo/ggrc-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlexNo/ggrc-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlexNo/ggrc-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlexNo/ggrc-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlexNo/ggrc-core/contents/{+path}","compare_url":"https://api.github.com/repos/AlexNo/ggrc-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlexNo/ggrc-core/merges","archive_url":"https://api.github.com/repos/AlexNo/ggrc-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlexNo/ggrc-core/downloads","issues_url":"https://api.github.com/repos/AlexNo/ggrc-core/issues{/number}","pulls_url":"https://api.github.com/repos/AlexNo/ggrc-core/pulls{/number}","milestones_url":"https://api.github.com/repos/AlexNo/ggrc-core/milestones{/number}","notifications_url":"https://api.github.com/repos/AlexNo/ggrc-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlexNo/ggrc-core/labels{/name}","releases_url":"https://api.github.com/repos/AlexNo/ggrc-core/releases{/id}","deployments_url":"https://api.github.com/repos/AlexNo/ggrc-core/deployments","created_at":"2016-05-23T10:13:18Z","updated_at":"2016-05-23T10:13:26Z","pushed_at":"2016-08-04T09:39:25Z","git_url":"git://github.com/AlexNo/ggrc-core.git","ssh_url":"git@github.com:AlexNo/ggrc-core.git","clone_url":"https://github.com/AlexNo/ggrc-core.git","svn_url":"https://github.com/AlexNo/ggrc-core","homepage":null,"size":53670,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"google:develop","ref":"develop","sha":"7962ed0796bdbb936402e28cf29da9ec18a94a9c","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":9304637,"name":"ggrc-core","full_name":"google/ggrc-core","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/ggrc-core","description":"GGRC Core","fork":false,"url":"https://api.github.com/repos/google/ggrc-core","forks_url":"https://api.github.com/repos/google/ggrc-core/forks","keys_url":"https://api.github.com/repos/google/ggrc-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/ggrc-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/ggrc-core/teams","hooks_url":"https://api.github.com/repos/google/ggrc-core/hooks","issue_events_url":"https://api.github.com/repos/google/ggrc-core/issues/events{/number}","events_url":"https://api.github.com/repos/google/ggrc-core/events","assignees_url":"https://api.github.com/repos/google/ggrc-core/assignees{/user}","branches_url":"https://api.github.com/repos/google/ggrc-core/branches{/branch}","tags_url":"https://api.github.com/repos/google/ggrc-core/tags","blobs_url":"https://api.github.com/repos/google/ggrc-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/ggrc-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/ggrc-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/ggrc-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/ggrc-core/statuses/{sha}","languages_url":"https://api.github.com/repos/google/ggrc-core/languages","stargazers_url":"https://api.github.com/repos/google/ggrc-core/stargazers","contributors_url":"https://api.github.com/repos/google/ggrc-core/contributors","subscribers_url":"https://api.github.com/repos/google/ggrc-core/subscribers","subscription_url":"https://api.github.com/repos/google/ggrc-core/subscription","commits_url":"https://api.github.com/repos/google/ggrc-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/ggrc-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/ggrc-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/ggrc-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/ggrc-core/contents/{+path}","compare_url":"https://api.github.com/repos/google/ggrc-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/ggrc-core/merges","archive_url":"https://api.github.com/repos/google/ggrc-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/ggrc-core/downloads","issues_url":"https://api.github.com/repos/google/ggrc-core/issues{/number}","pulls_url":"https://api.github.com/repos/google/ggrc-core/pulls{/number}","milestones_url":"https://api.github.com/repos/google/ggrc-core/milestones{/number}","notifications_url":"https://api.github.com/repos/google/ggrc-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/ggrc-core/labels{/name}","releases_url":"https://api.github.com/repos/google/ggrc-core/releases{/id}","deployments_url":"https://api.github.com/repos/google/ggrc-core/deployments","created_at":"2013-04-08T19:16:28Z","updated_at":"2016-08-01T21:50:36Z","pushed_at":"2016-08-04T09:39:26Z","git_url":"git://github.com/google/ggrc-core.git","ssh_url":"git@github.com:google/ggrc-core.git","clone_url":"https://github.com/google/ggrc-core.git","svn_url":"https://github.com/google/ggrc-core","homepage":null,"size":64346,"stargazers_count":117,"watchers_count":117,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":87,"mirror_url":null,"open_issues_count":17,"forks":87,"open_issues":17,"watchers":117,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/google/ggrc-core/pulls/4222"},"html":{"href":"https://github.com/google/ggrc-core/pull/4222"},"issue":{"href":"https://api.github.com/repos/google/ggrc-core/issues/4222"},"comments":{"href":"https://api.github.com/repos/google/ggrc-core/issues/4222/comments"},"review_comments":{"href":"https://api.github.com/repos/google/ggrc-core/pulls/4222/comments"},"review_comment":{"href":"https://api.github.com/repos/google/ggrc-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/ggrc-core/pulls/4222/commits"},"statuses":{"href":"https://api.github.com/repos/google/ggrc-core/statuses/2dcddb43bae3dd10ca043b1f1b6d11011d94c67e"}}}}
{"actor":{"display_login":"AlexNo"}}