{"action":"created","comment":{"url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/pulls/comments/92236097","pull_request_review_id":12744455,"id":92236097,"diff_hunk":"@@ -1,30 +1,235 @@\n-/* jshint expr:true */\n-import { expect } from 'chai'\n-import {\n-  describeComponent,\n-  it\n-} from 'ember-mocha'\n+import Ember from 'ember'\n+import {expect} from 'chai'\n+import {$hook, initialize as initializeHook} from 'ember-hook'\n+import {describeComponent, it} from 'ember-mocha'\n import hbs from 'htmlbars-inline-precompile'\n+import {beforeEach, describe} from 'mocha'\n+import sinon from 'sinon'\n+import SpreadMixin from 'ember-spread'\n \n-describeComponent(\n-  'spread',\n-  'Integration: SpreadComponent',\n-  {\n-    integration: true\n-  },\n-  function () {\n-    it('renders', function () {\n-      // Set any properties with this.set('myProperty', 'value');\n-      // Handle any actions with this.on('myAction', function(val) { ... });\n-      // Template block usage:\n-      // this.render(hbs`\n-      //   {{#spread}}\n-      //     template content\n-      //   {{/spread}}\n-      // `);\n-\n-      this.render(hbs`{{spread}}`)\n-      expect(this.$()).to.have.length(1)\n-    })\n-  }\n-)\n+import {integration} from 'dummy/tests/helpers/ember-test-utils/describe-component'\n+\n+describeComponent(...integration('spread'), function () {\n+  let handler\n+\n+  beforeEach(function () {\n+    initializeHook()\n+\n+    this.registry.register('component:spread-test', Ember.Component.extend(SpreadMixin, {\n+\n+      // == Properties ============================================================\n+\n+      hook: 'spread-test',\n+      layout: hbs`\n+        <div data-test={{hook 'spread-property'}}>\n+          {{property}}\n+        </div>\n+      `,\n+\n+      // == Actions ===============================================================\n+\n+      click () {\n+        this.onClick()\n+      }\n+    }))\n+\n+    handler = sinon.spy()\n+  })\n+\n+  describe('when using the default (options) spread property', function () {\n+    beforeEach(function () {\n+      this.setProperties({\n+        options: {\n+          property: 'Neat',\n+          onClick: handler\n+        }\n+      })\n+\n+      this.render(hbs`\n+        {{spread-test\n+          options=options\n+        }}\n+      `)\n+    })\n+\n+    it('should bind spread properties as local properties', function () {\n+      expect($hook('spread-property').text().trim()).to.equal('Neat')\n+    })\n+\n+    it('should bind spread functions as local functions', function () {\n+      $hook('spread-test').click()\n+\n+      expect(handler).to.have.callCount(1)\n+    })","path":"tests/integration/components/spread-test.js","position":91,"original_position":91,"commit_id":"a35a0cf6de12cb49bf075196d3f99645be82eb60","original_commit_id":"a35a0cf6de12cb49bf075196d3f99645be82eb60","user":{"login":"job13er","id":411788,"avatar_url":"https://avatars.githubusercontent.com/u/411788?v=3","gravatar_id":"","url":"https://api.github.com/users/job13er","html_url":"https://github.com/job13er","followers_url":"https://api.github.com/users/job13er/followers","following_url":"https://api.github.com/users/job13er/following{/other_user}","gists_url":"https://api.github.com/users/job13er/gists{/gist_id}","starred_url":"https://api.github.com/users/job13er/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/job13er/subscriptions","organizations_url":"https://api.github.com/users/job13er/orgs","repos_url":"https://api.github.com/users/job13er/repos","events_url":"https://api.github.com/users/job13er/events{/privacy}","received_events_url":"https://api.github.com/users/job13er/received_events","type":"User","site_admin":false},"body":"A couple suggestions here. \r\n\r\n1) The reason this is a test for what it says it's a test for is b/c of the implementation of the `click` action in the `spread-test` component above, right? If it used `this.get('onClick')()` instead of `this.onClick()` then the description would no longer be valid, correct? Something about that bothers me, maybe we should just add a comment explaining that, because just looking at this test, it doesn't look like the `it` text is accurate, even though it is. \r\n\r\n2) I really try to put all actions into `beforeEach()` so you can describe what it is that you're doing separate from what it is you're expecting to happen after that action is performed. In this case, however, you're not actually testing that when the thing is clicked it calls the handler, you're confirming something more internal, the way in which the spread property is set on the component itself, so it probably wouldn't make as much sense to say something like: \r\n\r\n```js\r\ndescribe('when spread-test is clicked', function () {\r\n  beforeEach(function () {\r\n    $hook('spread-test').click()\r\n  })\r\n\r\n  it('should call the locally bound function', function () {\r\n    expect(handler).to.have.callCount(1)\r\n  })\r\n})\r\n```","created_at":"2016-12-13T18:39:16Z","updated_at":"2016-12-13T18:53:42Z","html_url":"https://github.com/ciena-blueplanet/ember-spread/pull/14#discussion_r92236097","pull_request_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/ciena-blueplanet/ember-spread/pulls/comments/92236097"},"html":{"href":"https://github.com/ciena-blueplanet/ember-spread/pull/14#discussion_r92236097"},"pull_request":{"href":"https://api.github.com/repos/ciena-blueplanet/ember-spread/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/pulls/14","id":97690622,"html_url":"https://github.com/ciena-blueplanet/ember-spread/pull/14","diff_url":"https://github.com/ciena-blueplanet/ember-spread/pull/14.diff","patch_url":"https://github.com/ciena-blueplanet/ember-spread/pull/14.patch","issue_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/issues/14","number":14,"state":"open","locked":false,"title":"Cleanup and tests","user":{"login":"sglanzer","id":9026198,"avatar_url":"https://avatars.githubusercontent.com/u/9026198?v=3","gravatar_id":"","url":"https://api.github.com/users/sglanzer","html_url":"https://github.com/sglanzer","followers_url":"https://api.github.com/users/sglanzer/followers","following_url":"https://api.github.com/users/sglanzer/following{/other_user}","gists_url":"https://api.github.com/users/sglanzer/gists{/gist_id}","starred_url":"https://api.github.com/users/sglanzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sglanzer/subscriptions","organizations_url":"https://api.github.com/users/sglanzer/orgs","repos_url":"https://api.github.com/users/sglanzer/repos","events_url":"https://api.github.com/users/sglanzer/events{/privacy}","received_events_url":"https://api.github.com/users/sglanzer/received_events","type":"User","site_admin":false},"body":"#major#\r\n\r\nCleans up the interface (adjustment to a feature nobody is currently using) - tests make it ready for prime time\r\n\r\n# CHANGELOG\r\n\r\n* Dynamic spread is now driven via `spreadOptions=(hash source=(hash object=... property=...))`\r\n* Added tests","created_at":"2016-12-13T05:53:10Z","updated_at":"2016-12-13T18:53:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f43d6d3c9dcab392b265b59ec3ffc83d776d6d0a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/pulls/14/commits","review_comments_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/pulls/14/comments","review_comment_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/issues/14/comments","statuses_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/statuses/a35a0cf6de12cb49bf075196d3f99645be82eb60","head":{"label":"sglanzer:master","ref":"master","sha":"a35a0cf6de12cb49bf075196d3f99645be82eb60","user":{"login":"sglanzer","id":9026198,"avatar_url":"https://avatars.githubusercontent.com/u/9026198?v=3","gravatar_id":"","url":"https://api.github.com/users/sglanzer","html_url":"https://github.com/sglanzer","followers_url":"https://api.github.com/users/sglanzer/followers","following_url":"https://api.github.com/users/sglanzer/following{/other_user}","gists_url":"https://api.github.com/users/sglanzer/gists{/gist_id}","starred_url":"https://api.github.com/users/sglanzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sglanzer/subscriptions","organizations_url":"https://api.github.com/users/sglanzer/orgs","repos_url":"https://api.github.com/users/sglanzer/repos","events_url":"https://api.github.com/users/sglanzer/events{/privacy}","received_events_url":"https://api.github.com/users/sglanzer/received_events","type":"User","site_admin":false},"repo":{"id":73632138,"name":"ember-spread","full_name":"sglanzer/ember-spread","owner":{"login":"sglanzer","id":9026198,"avatar_url":"https://avatars.githubusercontent.com/u/9026198?v=3","gravatar_id":"","url":"https://api.github.com/users/sglanzer","html_url":"https://github.com/sglanzer","followers_url":"https://api.github.com/users/sglanzer/followers","following_url":"https://api.github.com/users/sglanzer/following{/other_user}","gists_url":"https://api.github.com/users/sglanzer/gists{/gist_id}","starred_url":"https://api.github.com/users/sglanzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sglanzer/subscriptions","organizations_url":"https://api.github.com/users/sglanzer/orgs","repos_url":"https://api.github.com/users/sglanzer/repos","events_url":"https://api.github.com/users/sglanzer/events{/privacy}","received_events_url":"https://api.github.com/users/sglanzer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sglanzer/ember-spread","description":"Dynamic options for dynamic components","fork":true,"url":"https://api.github.com/repos/sglanzer/ember-spread","forks_url":"https://api.github.com/repos/sglanzer/ember-spread/forks","keys_url":"https://api.github.com/repos/sglanzer/ember-spread/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sglanzer/ember-spread/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sglanzer/ember-spread/teams","hooks_url":"https://api.github.com/repos/sglanzer/ember-spread/hooks","issue_events_url":"https://api.github.com/repos/sglanzer/ember-spread/issues/events{/number}","events_url":"https://api.github.com/repos/sglanzer/ember-spread/events","assignees_url":"https://api.github.com/repos/sglanzer/ember-spread/assignees{/user}","branches_url":"https://api.github.com/repos/sglanzer/ember-spread/branches{/branch}","tags_url":"https://api.github.com/repos/sglanzer/ember-spread/tags","blobs_url":"https://api.github.com/repos/sglanzer/ember-spread/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sglanzer/ember-spread/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sglanzer/ember-spread/git/refs{/sha}","trees_url":"https://api.github.com/repos/sglanzer/ember-spread/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sglanzer/ember-spread/statuses/{sha}","languages_url":"https://api.github.com/repos/sglanzer/ember-spread/languages","stargazers_url":"https://api.github.com/repos/sglanzer/ember-spread/stargazers","contributors_url":"https://api.github.com/repos/sglanzer/ember-spread/contributors","subscribers_url":"https://api.github.com/repos/sglanzer/ember-spread/subscribers","subscription_url":"https://api.github.com/repos/sglanzer/ember-spread/subscription","commits_url":"https://api.github.com/repos/sglanzer/ember-spread/commits{/sha}","git_commits_url":"https://api.github.com/repos/sglanzer/ember-spread/git/commits{/sha}","comments_url":"https://api.github.com/repos/sglanzer/ember-spread/comments{/number}","issue_comment_url":"https://api.github.com/repos/sglanzer/ember-spread/issues/comments{/number}","contents_url":"https://api.github.com/repos/sglanzer/ember-spread/contents/{+path}","compare_url":"https://api.github.com/repos/sglanzer/ember-spread/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sglanzer/ember-spread/merges","archive_url":"https://api.github.com/repos/sglanzer/ember-spread/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sglanzer/ember-spread/downloads","issues_url":"https://api.github.com/repos/sglanzer/ember-spread/issues{/number}","pulls_url":"https://api.github.com/repos/sglanzer/ember-spread/pulls{/number}","milestones_url":"https://api.github.com/repos/sglanzer/ember-spread/milestones{/number}","notifications_url":"https://api.github.com/repos/sglanzer/ember-spread/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sglanzer/ember-spread/labels{/name}","releases_url":"https://api.github.com/repos/sglanzer/ember-spread/releases{/id}","deployments_url":"https://api.github.com/repos/sglanzer/ember-spread/deployments","created_at":"2016-11-13T17:42:22Z","updated_at":"2016-11-13T17:44:09Z","pushed_at":"2016-12-13T17:34:28Z","git_url":"git://github.com/sglanzer/ember-spread.git","ssh_url":"git@github.com:sglanzer/ember-spread.git","clone_url":"https://github.com/sglanzer/ember-spread.git","svn_url":"https://github.com/sglanzer/ember-spread","homepage":null,"size":79,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"ciena-blueplanet:master","ref":"master","sha":"d843425f54eecee6dde91fa93d28e46a0cb5eb06","user":{"login":"ciena-blueplanet","id":4604820,"avatar_url":"https://avatars.githubusercontent.com/u/4604820?v=3","gravatar_id":"","url":"https://api.github.com/users/ciena-blueplanet","html_url":"https://github.com/ciena-blueplanet","followers_url":"https://api.github.com/users/ciena-blueplanet/followers","following_url":"https://api.github.com/users/ciena-blueplanet/following{/other_user}","gists_url":"https://api.github.com/users/ciena-blueplanet/gists{/gist_id}","starred_url":"https://api.github.com/users/ciena-blueplanet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ciena-blueplanet/subscriptions","organizations_url":"https://api.github.com/users/ciena-blueplanet/orgs","repos_url":"https://api.github.com/users/ciena-blueplanet/repos","events_url":"https://api.github.com/users/ciena-blueplanet/events{/privacy}","received_events_url":"https://api.github.com/users/ciena-blueplanet/received_events","type":"Organization","site_admin":false},"repo":{"id":73632130,"name":"ember-spread","full_name":"ciena-blueplanet/ember-spread","owner":{"login":"ciena-blueplanet","id":4604820,"avatar_url":"https://avatars.githubusercontent.com/u/4604820?v=3","gravatar_id":"","url":"https://api.github.com/users/ciena-blueplanet","html_url":"https://github.com/ciena-blueplanet","followers_url":"https://api.github.com/users/ciena-blueplanet/followers","following_url":"https://api.github.com/users/ciena-blueplanet/following{/other_user}","gists_url":"https://api.github.com/users/ciena-blueplanet/gists{/gist_id}","starred_url":"https://api.github.com/users/ciena-blueplanet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ciena-blueplanet/subscriptions","organizations_url":"https://api.github.com/users/ciena-blueplanet/orgs","repos_url":"https://api.github.com/users/ciena-blueplanet/repos","events_url":"https://api.github.com/users/ciena-blueplanet/events{/privacy}","received_events_url":"https://api.github.com/users/ciena-blueplanet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ciena-blueplanet/ember-spread","description":"Dynamic options for dynamic components","fork":false,"url":"https://api.github.com/repos/ciena-blueplanet/ember-spread","forks_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/forks","keys_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/teams","hooks_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/hooks","issue_events_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/issues/events{/number}","events_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/events","assignees_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/assignees{/user}","branches_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/branches{/branch}","tags_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/tags","blobs_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/git/refs{/sha}","trees_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/statuses/{sha}","languages_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/languages","stargazers_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/stargazers","contributors_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/contributors","subscribers_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/subscribers","subscription_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/subscription","commits_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/commits{/sha}","git_commits_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/git/commits{/sha}","comments_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/comments{/number}","issue_comment_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/issues/comments{/number}","contents_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/contents/{+path}","compare_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/merges","archive_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/downloads","issues_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/issues{/number}","pulls_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/pulls{/number}","milestones_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/milestones{/number}","notifications_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/labels{/name}","releases_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/releases{/id}","deployments_url":"https://api.github.com/repos/ciena-blueplanet/ember-spread/deployments","created_at":"2016-11-13T17:42:14Z","updated_at":"2016-12-03T05:52:58Z","pushed_at":"2016-12-13T17:34:29Z","git_url":"git://github.com/ciena-blueplanet/ember-spread.git","ssh_url":"git@github.com:ciena-blueplanet/ember-spread.git","clone_url":"https://github.com/ciena-blueplanet/ember-spread.git","svn_url":"https://github.com/ciena-blueplanet/ember-spread","homepage":"https://ciena-blueplanet.github.io/ember-spread/","size":793,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4,"mirror_url":null,"open_issues_count":2,"forks":4,"open_issues":2,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ciena-blueplanet/ember-spread/pulls/14"},"html":{"href":"https://github.com/ciena-blueplanet/ember-spread/pull/14"},"issue":{"href":"https://api.github.com/repos/ciena-blueplanet/ember-spread/issues/14"},"comments":{"href":"https://api.github.com/repos/ciena-blueplanet/ember-spread/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/ciena-blueplanet/ember-spread/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/ciena-blueplanet/ember-spread/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ciena-blueplanet/ember-spread/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/ciena-blueplanet/ember-spread/statuses/a35a0cf6de12cb49bf075196d3f99645be82eb60"}}}}
{"actor":{"display_login":"job13er"}}