{"action":"created","comment":{"url":"https://api.github.com/repos/trunk-studio/cargocms/pulls/comments/79338149","id":79338149,"diff_hunk":"@@ -0,0 +1,65 @@\n+var sinon = require('sinon');\n+describe('about LikeRecipe Controller operation.', function() {\n+\n+  let recipe;\n+  before(async (done) => {\n+    try {\n+      let user = await User.create({\n+        username: 'likeRecipeUserController',\n+        email: 'likeRecipeUserController@gmail.com',\n+        password: ''\n+      });\n+      sinon.stub(AuthService, 'getSessionUser', (req) => {\n+        return user.toJSON();\n+      });\n+      recipe = await Recipe.create({\n+        formula:[\n+          {\"drops\":\"1\",\"scent\":\"BA69\",\"color\":\"#E87728\"},\n+          {\"drops\":\"2\",\"scent\":\"BA70\",\"color\":\"#B35721\"}\n+        ],\n+        formulaLogs: '',\n+        authorName: '王大明',\n+        perfumeName: 'love test',\n+        message: 'this is love test',\n+        UserId: user.id,\n+      });\n+      done()\n+    } catch (e) {\n+      done(e)\n+    }\n+  });\n+\n+  after((done) => {\n+    AuthService.getSessionUser.restore();\n+    done();\n+  });\n+\n+  it('Recipe to CSV should be success.', async (done) => {\n+    try {\n+      const webForm = { draw: '1',\n+        columns:[\n+           { data: 'id', name: '' },\n+           { data: 'perfumeName', name: '', \"searchable\": \"false\"},\n+           //only capture User.displayName to CSV\n+           { data: 'User', name: '', \"searchable\": \"false\"},\n+           { data: 'createdAt', name: '', \"searchable\": \"false\"},\n+           { data: 'visibilityDesc', name: '', \"searchable\": \"false\"},\n+           { data: 'productionStatusDesc', name: '', \"searchable\": \"false\"},\n+           { data: 'description', name: '', \"searchable\": \"false\"},\n+           { data: 'message', name: '', \"searchable\": \"false\"},\n+           { data: 'formula', name: '', \"searchable\": \"false\"},","path":"test/unit/controllers/api/admin/labfnp/RecipeControll.spec.js","position":50,"original_position":50,"commit_id":"2b4d85d7ceb05a5262c672b3e76997db899e5e5f","original_commit_id":"2b4d85d7ceb05a5262c672b3e76997db899e5e5f","user":{"login":"dd-han","id":5909203,"avatar_url":"https://avatars.githubusercontent.com/u/5909203?v=3","gravatar_id":"","url":"https://api.github.com/users/dd-han","html_url":"https://github.com/dd-han","followers_url":"https://api.github.com/users/dd-han/followers","following_url":"https://api.github.com/users/dd-han/following{/other_user}","gists_url":"https://api.github.com/users/dd-han/gists{/gist_id}","starred_url":"https://api.github.com/users/dd-han/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dd-han/subscriptions","organizations_url":"https://api.github.com/users/dd-han/orgs","repos_url":"https://api.github.com/users/dd-han/repos","events_url":"https://api.github.com/users/dd-han/events{/privacy}","received_events_url":"https://api.github.com/users/dd-han/received_events","type":"User","site_admin":false},"body":"`productionStatus`我是想說已經有`productionStatusDesc`，在輸出CSV的時候應該是沒必要送兩個重複欄位`visibility`也是。`authorName`因為從前端看沒注意，確實不需要`User`直接拉`authorName`比較快","created_at":"2016-09-19T07:35:10Z","updated_at":"2016-09-19T07:35:10Z","html_url":"https://github.com/trunk-studio/cargocms/pull/524#discussion_r79338149","pull_request_url":"https://api.github.com/repos/trunk-studio/cargocms/pulls/524","_links":{"self":{"href":"https://api.github.com/repos/trunk-studio/cargocms/pulls/comments/79338149"},"html":{"href":"https://github.com/trunk-studio/cargocms/pull/524#discussion_r79338149"},"pull_request":{"href":"https://api.github.com/repos/trunk-studio/cargocms/pulls/524"}}},"pull_request":{"url":"https://api.github.com/repos/trunk-studio/cargocms/pulls/524","id":85735377,"html_url":"https://github.com/trunk-studio/cargocms/pull/524","diff_url":"https://github.com/trunk-studio/cargocms/pull/524.diff","patch_url":"https://github.com/trunk-studio/cargocms/pull/524.patch","issue_url":"https://api.github.com/repos/trunk-studio/cargocms/issues/524","number":524,"state":"open","locked":false,"title":"new API Sepc for issue #492","user":{"login":"dd-han","id":5909203,"avatar_url":"https://avatars.githubusercontent.com/u/5909203?v=3","gravatar_id":"","url":"https://api.github.com/users/dd-han","html_url":"https://github.com/dd-han","followers_url":"https://api.github.com/users/dd-han/followers","following_url":"https://api.github.com/users/dd-han/following{/other_user}","gists_url":"https://api.github.com/users/dd-han/gists{/gist_id}","starred_url":"https://api.github.com/users/dd-han/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dd-han/subscriptions","organizations_url":"https://api.github.com/users/dd-han/orgs","repos_url":"https://api.github.com/users/dd-han/repos","events_url":"https://api.github.com/users/dd-han/events{/privacy}","received_events_url":"https://api.github.com/users/dd-han/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-19T03:46:34Z","updated_at":"2016-09-19T07:35:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"58c560df0816fc5f15ea299b7c9b5ce4f0cec0bf","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/trunk-studio/cargocms/pulls/524/commits","review_comments_url":"https://api.github.com/repos/trunk-studio/cargocms/pulls/524/comments","review_comment_url":"https://api.github.com/repos/trunk-studio/cargocms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/trunk-studio/cargocms/issues/524/comments","statuses_url":"https://api.github.com/repos/trunk-studio/cargocms/statuses/2b4d85d7ceb05a5262c672b3e76997db899e5e5f","head":{"label":"trunk-studio:feature/492","ref":"feature/492","sha":"2b4d85d7ceb05a5262c672b3e76997db899e5e5f","user":{"login":"trunk-studio","id":12459749,"avatar_url":"https://avatars.githubusercontent.com/u/12459749?v=3","gravatar_id":"","url":"https://api.github.com/users/trunk-studio","html_url":"https://github.com/trunk-studio","followers_url":"https://api.github.com/users/trunk-studio/followers","following_url":"https://api.github.com/users/trunk-studio/following{/other_user}","gists_url":"https://api.github.com/users/trunk-studio/gists{/gist_id}","starred_url":"https://api.github.com/users/trunk-studio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trunk-studio/subscriptions","organizations_url":"https://api.github.com/users/trunk-studio/orgs","repos_url":"https://api.github.com/users/trunk-studio/repos","events_url":"https://api.github.com/users/trunk-studio/events{/privacy}","received_events_url":"https://api.github.com/users/trunk-studio/received_events","type":"Organization","site_admin":false},"repo":{"id":63765534,"name":"cargocms","full_name":"trunk-studio/cargocms","owner":{"login":"trunk-studio","id":12459749,"avatar_url":"https://avatars.githubusercontent.com/u/12459749?v=3","gravatar_id":"","url":"https://api.github.com/users/trunk-studio","html_url":"https://github.com/trunk-studio","followers_url":"https://api.github.com/users/trunk-studio/followers","following_url":"https://api.github.com/users/trunk-studio/following{/other_user}","gists_url":"https://api.github.com/users/trunk-studio/gists{/gist_id}","starred_url":"https://api.github.com/users/trunk-studio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trunk-studio/subscriptions","organizations_url":"https://api.github.com/users/trunk-studio/orgs","repos_url":"https://api.github.com/users/trunk-studio/repos","events_url":"https://api.github.com/users/trunk-studio/events{/privacy}","received_events_url":"https://api.github.com/users/trunk-studio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/trunk-studio/cargocms","description":"Cargo CMS","fork":false,"url":"https://api.github.com/repos/trunk-studio/cargocms","forks_url":"https://api.github.com/repos/trunk-studio/cargocms/forks","keys_url":"https://api.github.com/repos/trunk-studio/cargocms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trunk-studio/cargocms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trunk-studio/cargocms/teams","hooks_url":"https://api.github.com/repos/trunk-studio/cargocms/hooks","issue_events_url":"https://api.github.com/repos/trunk-studio/cargocms/issues/events{/number}","events_url":"https://api.github.com/repos/trunk-studio/cargocms/events","assignees_url":"https://api.github.com/repos/trunk-studio/cargocms/assignees{/user}","branches_url":"https://api.github.com/repos/trunk-studio/cargocms/branches{/branch}","tags_url":"https://api.github.com/repos/trunk-studio/cargocms/tags","blobs_url":"https://api.github.com/repos/trunk-studio/cargocms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trunk-studio/cargocms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trunk-studio/cargocms/git/refs{/sha}","trees_url":"https://api.github.com/repos/trunk-studio/cargocms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trunk-studio/cargocms/statuses/{sha}","languages_url":"https://api.github.com/repos/trunk-studio/cargocms/languages","stargazers_url":"https://api.github.com/repos/trunk-studio/cargocms/stargazers","contributors_url":"https://api.github.com/repos/trunk-studio/cargocms/contributors","subscribers_url":"https://api.github.com/repos/trunk-studio/cargocms/subscribers","subscription_url":"https://api.github.com/repos/trunk-studio/cargocms/subscription","commits_url":"https://api.github.com/repos/trunk-studio/cargocms/commits{/sha}","git_commits_url":"https://api.github.com/repos/trunk-studio/cargocms/git/commits{/sha}","comments_url":"https://api.github.com/repos/trunk-studio/cargocms/comments{/number}","issue_comment_url":"https://api.github.com/repos/trunk-studio/cargocms/issues/comments{/number}","contents_url":"https://api.github.com/repos/trunk-studio/cargocms/contents/{+path}","compare_url":"https://api.github.com/repos/trunk-studio/cargocms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trunk-studio/cargocms/merges","archive_url":"https://api.github.com/repos/trunk-studio/cargocms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trunk-studio/cargocms/downloads","issues_url":"https://api.github.com/repos/trunk-studio/cargocms/issues{/number}","pulls_url":"https://api.github.com/repos/trunk-studio/cargocms/pulls{/number}","milestones_url":"https://api.github.com/repos/trunk-studio/cargocms/milestones{/number}","notifications_url":"https://api.github.com/repos/trunk-studio/cargocms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trunk-studio/cargocms/labels{/name}","releases_url":"https://api.github.com/repos/trunk-studio/cargocms/releases{/id}","deployments_url":"https://api.github.com/repos/trunk-studio/cargocms/deployments","created_at":"2016-07-20T08:45:49Z","updated_at":"2016-07-28T09:56:09Z","pushed_at":"2016-09-19T06:58:59Z","git_url":"git://github.com/trunk-studio/cargocms.git","ssh_url":"git@github.com:trunk-studio/cargocms.git","clone_url":"https://github.com/trunk-studio/cargocms.git","svn_url":"https://github.com/trunk-studio/cargocms","homepage":"http://cargo.trunksys.com","size":63564,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":11,"mirror_url":null,"open_issues_count":112,"forks":11,"open_issues":112,"watchers":0,"default_branch":"master"}},"base":{"label":"trunk-studio:develop","ref":"develop","sha":"c2d110698f9f9a9153f30e5262ec3ca8bbcc3343","user":{"login":"trunk-studio","id":12459749,"avatar_url":"https://avatars.githubusercontent.com/u/12459749?v=3","gravatar_id":"","url":"https://api.github.com/users/trunk-studio","html_url":"https://github.com/trunk-studio","followers_url":"https://api.github.com/users/trunk-studio/followers","following_url":"https://api.github.com/users/trunk-studio/following{/other_user}","gists_url":"https://api.github.com/users/trunk-studio/gists{/gist_id}","starred_url":"https://api.github.com/users/trunk-studio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trunk-studio/subscriptions","organizations_url":"https://api.github.com/users/trunk-studio/orgs","repos_url":"https://api.github.com/users/trunk-studio/repos","events_url":"https://api.github.com/users/trunk-studio/events{/privacy}","received_events_url":"https://api.github.com/users/trunk-studio/received_events","type":"Organization","site_admin":false},"repo":{"id":63765534,"name":"cargocms","full_name":"trunk-studio/cargocms","owner":{"login":"trunk-studio","id":12459749,"avatar_url":"https://avatars.githubusercontent.com/u/12459749?v=3","gravatar_id":"","url":"https://api.github.com/users/trunk-studio","html_url":"https://github.com/trunk-studio","followers_url":"https://api.github.com/users/trunk-studio/followers","following_url":"https://api.github.com/users/trunk-studio/following{/other_user}","gists_url":"https://api.github.com/users/trunk-studio/gists{/gist_id}","starred_url":"https://api.github.com/users/trunk-studio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trunk-studio/subscriptions","organizations_url":"https://api.github.com/users/trunk-studio/orgs","repos_url":"https://api.github.com/users/trunk-studio/repos","events_url":"https://api.github.com/users/trunk-studio/events{/privacy}","received_events_url":"https://api.github.com/users/trunk-studio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/trunk-studio/cargocms","description":"Cargo CMS","fork":false,"url":"https://api.github.com/repos/trunk-studio/cargocms","forks_url":"https://api.github.com/repos/trunk-studio/cargocms/forks","keys_url":"https://api.github.com/repos/trunk-studio/cargocms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trunk-studio/cargocms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trunk-studio/cargocms/teams","hooks_url":"https://api.github.com/repos/trunk-studio/cargocms/hooks","issue_events_url":"https://api.github.com/repos/trunk-studio/cargocms/issues/events{/number}","events_url":"https://api.github.com/repos/trunk-studio/cargocms/events","assignees_url":"https://api.github.com/repos/trunk-studio/cargocms/assignees{/user}","branches_url":"https://api.github.com/repos/trunk-studio/cargocms/branches{/branch}","tags_url":"https://api.github.com/repos/trunk-studio/cargocms/tags","blobs_url":"https://api.github.com/repos/trunk-studio/cargocms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trunk-studio/cargocms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trunk-studio/cargocms/git/refs{/sha}","trees_url":"https://api.github.com/repos/trunk-studio/cargocms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trunk-studio/cargocms/statuses/{sha}","languages_url":"https://api.github.com/repos/trunk-studio/cargocms/languages","stargazers_url":"https://api.github.com/repos/trunk-studio/cargocms/stargazers","contributors_url":"https://api.github.com/repos/trunk-studio/cargocms/contributors","subscribers_url":"https://api.github.com/repos/trunk-studio/cargocms/subscribers","subscription_url":"https://api.github.com/repos/trunk-studio/cargocms/subscription","commits_url":"https://api.github.com/repos/trunk-studio/cargocms/commits{/sha}","git_commits_url":"https://api.github.com/repos/trunk-studio/cargocms/git/commits{/sha}","comments_url":"https://api.github.com/repos/trunk-studio/cargocms/comments{/number}","issue_comment_url":"https://api.github.com/repos/trunk-studio/cargocms/issues/comments{/number}","contents_url":"https://api.github.com/repos/trunk-studio/cargocms/contents/{+path}","compare_url":"https://api.github.com/repos/trunk-studio/cargocms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trunk-studio/cargocms/merges","archive_url":"https://api.github.com/repos/trunk-studio/cargocms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trunk-studio/cargocms/downloads","issues_url":"https://api.github.com/repos/trunk-studio/cargocms/issues{/number}","pulls_url":"https://api.github.com/repos/trunk-studio/cargocms/pulls{/number}","milestones_url":"https://api.github.com/repos/trunk-studio/cargocms/milestones{/number}","notifications_url":"https://api.github.com/repos/trunk-studio/cargocms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trunk-studio/cargocms/labels{/name}","releases_url":"https://api.github.com/repos/trunk-studio/cargocms/releases{/id}","deployments_url":"https://api.github.com/repos/trunk-studio/cargocms/deployments","created_at":"2016-07-20T08:45:49Z","updated_at":"2016-07-28T09:56:09Z","pushed_at":"2016-09-19T06:58:59Z","git_url":"git://github.com/trunk-studio/cargocms.git","ssh_url":"git@github.com:trunk-studio/cargocms.git","clone_url":"https://github.com/trunk-studio/cargocms.git","svn_url":"https://github.com/trunk-studio/cargocms","homepage":"http://cargo.trunksys.com","size":63564,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":11,"mirror_url":null,"open_issues_count":112,"forks":11,"open_issues":112,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/trunk-studio/cargocms/pulls/524"},"html":{"href":"https://github.com/trunk-studio/cargocms/pull/524"},"issue":{"href":"https://api.github.com/repos/trunk-studio/cargocms/issues/524"},"comments":{"href":"https://api.github.com/repos/trunk-studio/cargocms/issues/524/comments"},"review_comments":{"href":"https://api.github.com/repos/trunk-studio/cargocms/pulls/524/comments"},"review_comment":{"href":"https://api.github.com/repos/trunk-studio/cargocms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/trunk-studio/cargocms/pulls/524/commits"},"statuses":{"href":"https://api.github.com/repos/trunk-studio/cargocms/statuses/2b4d85d7ceb05a5262c672b3e76997db899e5e5f"}}}}
{"actor":{"display_login":"dd-han"}}