{"action":"created","comment":{"url":"https://api.github.com/repos/fxbox/foxbox/pulls/comments/61752501","id":61752501,"diff_hunk":"@@ -0,0 +1,188 @@\n+'use strict';\n+\n+const chakram = require('chakram'), expect = chakram.expect;\n+var Prepper = require('../lib/testPrepper.js');\n+\n+Prepper.makeSuite('Add/Remove recipe',function(){\n+\n+  var source = {'name': 'Hellooo, Thinkerbell', 'rules':\n+            [{'conditions':\n+              [{'source':\n+                [{'id':'OpenZWave72057594126794752 (Sensor)'}],\n+              'kind':'OpenClosed',\n+              'range':{'Eq':{'OpenClosed':'Open'}}\n+            }],\n+            'execute':\n+              [{'destination':\n+                [{'kind':'Log'}],\n+                'kind':'Log',\n+                'value':{'String':'Closed'}}]}\n+              ]};\n+    source = JSON.stringify(source);\n+\n+  before(Prepper.foxboxManager.foxboxLogin);\n+\n+  it('Check service list for recipe',function(){        \n+    return chakram.get(Prepper.foxboxManager.serviceListURL)\n+    .then(function(listResponse) {\n+      expect(listResponse).to.have.status(200);\n+      var found = false;\n+      for (var entry of listResponse.body) {\n+        if (entry.adapter === 'thinkerbell@link.mozilla.org') {\n+          found = true;                \n+        }\n+      }\n+      expect(found).equals(true);\n+    });\n+  });\n+  \n+  it('Add recipe',function(){\n+    \n+\n+    var payload = {\n+      'select':{\n+         'kind':'AddThinkerbellRule'\n+      },\n+      'value':{\n+         'ThinkerbellRule':{\n+            'name':'First Recipe',\n+            'source': source\n+          }\n+      }\n+    };\n+    return chakram.put(Prepper.foxboxManager.setterURL, payload)\n+    .then(function(cmdResponse) {\n+      expect(cmdResponse).to.have.status(200);\n+      expect(cmdResponse.body['thinkerbell-add-rule']).equals(null);\n+      return chakram.get(Prepper.foxboxManager.serviceListURL);\n+    })\n+    .then(function(listResponse) {\n+      var found = false;\n+      expect(listResponse).to.have.status(200);\n+      for (var entry of listResponse.body) {\n+        if (entry.adapter === 'thinkerbell@link.mozilla.org') {\n+          if (entry.id === 'thinkerbell/First Recipe') {\n+            found = true;\n+          }\n+        }\n+      }\n+      expect(found).equals(true);     \n+    });\n+  }); \n+\n+  it('Add two recipes at the same time',function(){        \n+    \n+    var payload = {","path":"test/integration/test/recipe_test.js","position":75,"original_position":75,"commit_id":"6d102068ca2d89d30cc866591f4bf45dc88bd289","original_commit_id":"6d102068ca2d89d30cc866591f4bf45dc88bd289","user":{"login":"npark-mozilla","id":6930774,"avatar_url":"https://avatars.githubusercontent.com/u/6930774?v=3","gravatar_id":"","url":"https://api.github.com/users/npark-mozilla","html_url":"https://github.com/npark-mozilla","followers_url":"https://api.github.com/users/npark-mozilla/followers","following_url":"https://api.github.com/users/npark-mozilla/following{/other_user}","gists_url":"https://api.github.com/users/npark-mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/npark-mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npark-mozilla/subscriptions","organizations_url":"https://api.github.com/users/npark-mozilla/orgs","repos_url":"https://api.github.com/users/npark-mozilla/repos","events_url":"https://api.github.com/users/npark-mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/npark-mozilla/received_events","type":"User","site_admin":false},"body":"I think I should do this refactoring once the decentralized taxonomy is in, I'm not sure whether I should put generateNewRecipePayload() inside foxbox.  For now, I have put them inside the recipe_test.js ","created_at":"2016-05-02T15:15:47Z","updated_at":"2016-05-02T15:15:47Z","html_url":"https://github.com/fxbox/foxbox/pull/448#discussion_r61752501","pull_request_url":"https://api.github.com/repos/fxbox/foxbox/pulls/448","_links":{"self":{"href":"https://api.github.com/repos/fxbox/foxbox/pulls/comments/61752501"},"html":{"href":"https://github.com/fxbox/foxbox/pull/448#discussion_r61752501"},"pull_request":{"href":"https://api.github.com/repos/fxbox/foxbox/pulls/448"}}},"pull_request":{"url":"https://api.github.com/repos/fxbox/foxbox/pulls/448","id":68459653,"html_url":"https://github.com/fxbox/foxbox/pull/448","diff_url":"https://github.com/fxbox/foxbox/pull/448.diff","patch_url":"https://github.com/fxbox/foxbox/pull/448.patch","issue_url":"https://api.github.com/repos/fxbox/foxbox/issues/448","number":448,"state":"open","locked":false,"title":"Recipe add/delete integration test","user":{"login":"npark-mozilla","id":6930774,"avatar_url":"https://avatars.githubusercontent.com/u/6930774?v=3","gravatar_id":"","url":"https://api.github.com/users/npark-mozilla","html_url":"https://github.com/npark-mozilla","followers_url":"https://api.github.com/users/npark-mozilla/followers","following_url":"https://api.github.com/users/npark-mozilla/following{/other_user}","gists_url":"https://api.github.com/users/npark-mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/npark-mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npark-mozilla/subscriptions","organizations_url":"https://api.github.com/users/npark-mozilla/orgs","repos_url":"https://api.github.com/users/npark-mozilla/repos","events_url":"https://api.github.com/users/npark-mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/npark-mozilla/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-30T06:06:32Z","updated_at":"2016-05-02T15:15:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a818c20965f3d5705cbc268299e9dd4b4e12a0fe","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fxbox/foxbox/pulls/448/commits","review_comments_url":"https://api.github.com/repos/fxbox/foxbox/pulls/448/comments","review_comment_url":"https://api.github.com/repos/fxbox/foxbox/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fxbox/foxbox/issues/448/comments","statuses_url":"https://api.github.com/repos/fxbox/foxbox/statuses/6d102068ca2d89d30cc866591f4bf45dc88bd289","head":{"label":"npark-mozilla:recipetest","ref":"recipetest","sha":"6d102068ca2d89d30cc866591f4bf45dc88bd289","user":{"login":"npark-mozilla","id":6930774,"avatar_url":"https://avatars.githubusercontent.com/u/6930774?v=3","gravatar_id":"","url":"https://api.github.com/users/npark-mozilla","html_url":"https://github.com/npark-mozilla","followers_url":"https://api.github.com/users/npark-mozilla/followers","following_url":"https://api.github.com/users/npark-mozilla/following{/other_user}","gists_url":"https://api.github.com/users/npark-mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/npark-mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npark-mozilla/subscriptions","organizations_url":"https://api.github.com/users/npark-mozilla/orgs","repos_url":"https://api.github.com/users/npark-mozilla/repos","events_url":"https://api.github.com/users/npark-mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/npark-mozilla/received_events","type":"User","site_admin":false},"repo":{"id":51610685,"name":"foxbox","full_name":"npark-mozilla/foxbox","owner":{"login":"npark-mozilla","id":6930774,"avatar_url":"https://avatars.githubusercontent.com/u/6930774?v=3","gravatar_id":"","url":"https://api.github.com/users/npark-mozilla","html_url":"https://github.com/npark-mozilla","followers_url":"https://api.github.com/users/npark-mozilla/followers","following_url":"https://api.github.com/users/npark-mozilla/following{/other_user}","gists_url":"https://api.github.com/users/npark-mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/npark-mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/npark-mozilla/subscriptions","organizations_url":"https://api.github.com/users/npark-mozilla/orgs","repos_url":"https://api.github.com/users/npark-mozilla/repos","events_url":"https://api.github.com/users/npark-mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/npark-mozilla/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/npark-mozilla/foxbox","description":"The FoxBox daemon","fork":true,"url":"https://api.github.com/repos/npark-mozilla/foxbox","forks_url":"https://api.github.com/repos/npark-mozilla/foxbox/forks","keys_url":"https://api.github.com/repos/npark-mozilla/foxbox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/npark-mozilla/foxbox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/npark-mozilla/foxbox/teams","hooks_url":"https://api.github.com/repos/npark-mozilla/foxbox/hooks","issue_events_url":"https://api.github.com/repos/npark-mozilla/foxbox/issues/events{/number}","events_url":"https://api.github.com/repos/npark-mozilla/foxbox/events","assignees_url":"https://api.github.com/repos/npark-mozilla/foxbox/assignees{/user}","branches_url":"https://api.github.com/repos/npark-mozilla/foxbox/branches{/branch}","tags_url":"https://api.github.com/repos/npark-mozilla/foxbox/tags","blobs_url":"https://api.github.com/repos/npark-mozilla/foxbox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/npark-mozilla/foxbox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/npark-mozilla/foxbox/git/refs{/sha}","trees_url":"https://api.github.com/repos/npark-mozilla/foxbox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/npark-mozilla/foxbox/statuses/{sha}","languages_url":"https://api.github.com/repos/npark-mozilla/foxbox/languages","stargazers_url":"https://api.github.com/repos/npark-mozilla/foxbox/stargazers","contributors_url":"https://api.github.com/repos/npark-mozilla/foxbox/contributors","subscribers_url":"https://api.github.com/repos/npark-mozilla/foxbox/subscribers","subscription_url":"https://api.github.com/repos/npark-mozilla/foxbox/subscription","commits_url":"https://api.github.com/repos/npark-mozilla/foxbox/commits{/sha}","git_commits_url":"https://api.github.com/repos/npark-mozilla/foxbox/git/commits{/sha}","comments_url":"https://api.github.com/repos/npark-mozilla/foxbox/comments{/number}","issue_comment_url":"https://api.github.com/repos/npark-mozilla/foxbox/issues/comments{/number}","contents_url":"https://api.github.com/repos/npark-mozilla/foxbox/contents/{+path}","compare_url":"https://api.github.com/repos/npark-mozilla/foxbox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/npark-mozilla/foxbox/merges","archive_url":"https://api.github.com/repos/npark-mozilla/foxbox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/npark-mozilla/foxbox/downloads","issues_url":"https://api.github.com/repos/npark-mozilla/foxbox/issues{/number}","pulls_url":"https://api.github.com/repos/npark-mozilla/foxbox/pulls{/number}","milestones_url":"https://api.github.com/repos/npark-mozilla/foxbox/milestones{/number}","notifications_url":"https://api.github.com/repos/npark-mozilla/foxbox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/npark-mozilla/foxbox/labels{/name}","releases_url":"https://api.github.com/repos/npark-mozilla/foxbox/releases{/id}","deployments_url":"https://api.github.com/repos/npark-mozilla/foxbox/deployments","created_at":"2016-02-12T19:21:56Z","updated_at":"2016-02-12T19:21:58Z","pushed_at":"2016-04-30T06:05:59Z","git_url":"git://github.com/npark-mozilla/foxbox.git","ssh_url":"git@github.com:npark-mozilla/foxbox.git","clone_url":"https://github.com/npark-mozilla/foxbox.git","svn_url":"https://github.com/npark-mozilla/foxbox","homepage":null,"size":2730,"stargazers_count":0,"watchers_count":0,"language":"Rust","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":"master"}},"base":{"label":"fxbox:master","ref":"master","sha":"812c352141f342709bf0e68e6c1f3e9e51faec5f","user":{"login":"fxbox","id":17052474,"avatar_url":"https://avatars.githubusercontent.com/u/17052474?v=3","gravatar_id":"","url":"https://api.github.com/users/fxbox","html_url":"https://github.com/fxbox","followers_url":"https://api.github.com/users/fxbox/followers","following_url":"https://api.github.com/users/fxbox/following{/other_user}","gists_url":"https://api.github.com/users/fxbox/gists{/gist_id}","starred_url":"https://api.github.com/users/fxbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fxbox/subscriptions","organizations_url":"https://api.github.com/users/fxbox/orgs","repos_url":"https://api.github.com/users/fxbox/repos","events_url":"https://api.github.com/users/fxbox/events{/privacy}","received_events_url":"https://api.github.com/users/fxbox/received_events","type":"Organization","site_admin":false},"repo":{"id":50702140,"name":"foxbox","full_name":"fxbox/foxbox","owner":{"login":"fxbox","id":17052474,"avatar_url":"https://avatars.githubusercontent.com/u/17052474?v=3","gravatar_id":"","url":"https://api.github.com/users/fxbox","html_url":"https://github.com/fxbox","followers_url":"https://api.github.com/users/fxbox/followers","following_url":"https://api.github.com/users/fxbox/following{/other_user}","gists_url":"https://api.github.com/users/fxbox/gists{/gist_id}","starred_url":"https://api.github.com/users/fxbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fxbox/subscriptions","organizations_url":"https://api.github.com/users/fxbox/orgs","repos_url":"https://api.github.com/users/fxbox/repos","events_url":"https://api.github.com/users/fxbox/events{/privacy}","received_events_url":"https://api.github.com/users/fxbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fxbox/foxbox","description":"The FoxBox daemon","fork":false,"url":"https://api.github.com/repos/fxbox/foxbox","forks_url":"https://api.github.com/repos/fxbox/foxbox/forks","keys_url":"https://api.github.com/repos/fxbox/foxbox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fxbox/foxbox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fxbox/foxbox/teams","hooks_url":"https://api.github.com/repos/fxbox/foxbox/hooks","issue_events_url":"https://api.github.com/repos/fxbox/foxbox/issues/events{/number}","events_url":"https://api.github.com/repos/fxbox/foxbox/events","assignees_url":"https://api.github.com/repos/fxbox/foxbox/assignees{/user}","branches_url":"https://api.github.com/repos/fxbox/foxbox/branches{/branch}","tags_url":"https://api.github.com/repos/fxbox/foxbox/tags","blobs_url":"https://api.github.com/repos/fxbox/foxbox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fxbox/foxbox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fxbox/foxbox/git/refs{/sha}","trees_url":"https://api.github.com/repos/fxbox/foxbox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fxbox/foxbox/statuses/{sha}","languages_url":"https://api.github.com/repos/fxbox/foxbox/languages","stargazers_url":"https://api.github.com/repos/fxbox/foxbox/stargazers","contributors_url":"https://api.github.com/repos/fxbox/foxbox/contributors","subscribers_url":"https://api.github.com/repos/fxbox/foxbox/subscribers","subscription_url":"https://api.github.com/repos/fxbox/foxbox/subscription","commits_url":"https://api.github.com/repos/fxbox/foxbox/commits{/sha}","git_commits_url":"https://api.github.com/repos/fxbox/foxbox/git/commits{/sha}","comments_url":"https://api.github.com/repos/fxbox/foxbox/comments{/number}","issue_comment_url":"https://api.github.com/repos/fxbox/foxbox/issues/comments{/number}","contents_url":"https://api.github.com/repos/fxbox/foxbox/contents/{+path}","compare_url":"https://api.github.com/repos/fxbox/foxbox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fxbox/foxbox/merges","archive_url":"https://api.github.com/repos/fxbox/foxbox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fxbox/foxbox/downloads","issues_url":"https://api.github.com/repos/fxbox/foxbox/issues{/number}","pulls_url":"https://api.github.com/repos/fxbox/foxbox/pulls{/number}","milestones_url":"https://api.github.com/repos/fxbox/foxbox/milestones{/number}","notifications_url":"https://api.github.com/repos/fxbox/foxbox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fxbox/foxbox/labels{/name}","releases_url":"https://api.github.com/repos/fxbox/foxbox/releases{/id}","deployments_url":"https://api.github.com/repos/fxbox/foxbox/deployments","created_at":"2016-01-30T01:13:10Z","updated_at":"2016-04-25T18:11:13Z","pushed_at":"2016-05-02T14:58:46Z","git_url":"git://github.com/fxbox/foxbox.git","ssh_url":"git@github.com:fxbox/foxbox.git","clone_url":"https://github.com/fxbox/foxbox.git","svn_url":"https://github.com/fxbox/foxbox","homepage":null,"size":2845,"stargazers_count":19,"watchers_count":19,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"open_issues_count":71,"forks":29,"open_issues":71,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fxbox/foxbox/pulls/448"},"html":{"href":"https://github.com/fxbox/foxbox/pull/448"},"issue":{"href":"https://api.github.com/repos/fxbox/foxbox/issues/448"},"comments":{"href":"https://api.github.com/repos/fxbox/foxbox/issues/448/comments"},"review_comments":{"href":"https://api.github.com/repos/fxbox/foxbox/pulls/448/comments"},"review_comment":{"href":"https://api.github.com/repos/fxbox/foxbox/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fxbox/foxbox/pulls/448/commits"},"statuses":{"href":"https://api.github.com/repos/fxbox/foxbox/statuses/6d102068ca2d89d30cc866591f4bf45dc88bd289"}}}}