{"action":"created","issue":{"url":"https://api.github.com/repos/SumOfUs/Champaign/issues/245","labels_url":"https://api.github.com/repos/SumOfUs/Champaign/issues/245/labels{/name}","comments_url":"https://api.github.com/repos/SumOfUs/Champaign/issues/245/comments","events_url":"https://api.github.com/repos/SumOfUs/Champaign/issues/245/events","html_url":"https://github.com/SumOfUs/Champaign/pull/245","id":118437320,"number":245,"title":"Magic teaspoon","user":{"login":"NealJMD","id":102218,"avatar_url":"https://avatars.githubusercontent.com/u/102218?v=3","gravatar_id":"","url":"https://api.github.com/users/NealJMD","html_url":"https://github.com/NealJMD","followers_url":"https://api.github.com/users/NealJMD/followers","following_url":"https://api.github.com/users/NealJMD/following{/other_user}","gists_url":"https://api.github.com/users/NealJMD/gists{/gist_id}","starred_url":"https://api.github.com/users/NealJMD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NealJMD/subscriptions","organizations_url":"https://api.github.com/users/NealJMD/orgs","repos_url":"https://api.github.com/users/NealJMD/repos","events_url":"https://api.github.com/users/NealJMD/events{/privacy}","received_events_url":"https://api.github.com/users/NealJMD/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-23T18:01:54Z","updated_at":"2015-11-27T16:07:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/SumOfUs/Champaign/pulls/245","html_url":"https://github.com/SumOfUs/Champaign/pull/245","diff_url":"https://github.com/SumOfUs/Champaign/pull/245.diff","patch_url":"https://github.com/SumOfUs/Champaign/pull/245.patch"},"body":"Testing our javascript with Mocha, Chai, Teaspoon, and Magic Lamp\r\n\r\n- [Mocha](https://github.com/mochajs/mocha) - a test runner, equivalent to rspec. It loads an html fixture and whatever javascript you want and runs the javascript in the context of the html fixture.\r\n- [Chai](https://github.com/chaijs/chai) - a set of matchers that define the syntax for the actual expectations. I'm using the ones that make it look like rspec. Also using [chai-jquery](https://github.com/chaijs/chai-jquery) to do things like `expect($el).to.have.class('hidden')`\r\n- [Teaspoon](https://github.com/modeset/teaspoon) - integration of Mocha into the Rails app. it lets us do things like sprockets imports of the javascript assets into the test files, gives us a rake task to run the tests, runs the asset pipeline, and provides a bunch of config options.\r\n- [Magic Lamp](https://github.com/crismali/magic_lamp) - this one's the real magic. it lets you define fixtures not as html, but as ruby that runs in the context of a specified controller. It lets you generate examples with factory girl, call the controller action, and then use the HTML rendered by the controller as the fixture to run the javascript. It's great.\r\n\r\nit's still a tiny bit tricky - you have to remember to run it with RAILS_ENV=test or it'll wipe out your db. there's also a weird thread error with unlocking a mutex locked by another thread that seems to appear in a way that's hard to define causation. but hopefully will all be sorted soon."},"comment":{"url":"https://api.github.com/repos/SumOfUs/Champaign/issues/comments/160167547","html_url":"https://github.com/SumOfUs/Champaign/pull/245#issuecomment-160167547","issue_url":"https://api.github.com/repos/SumOfUs/Champaign/issues/245","id":160167547,"user":{"login":"osahyoun","id":12949,"avatar_url":"https://avatars.githubusercontent.com/u/12949?v=3","gravatar_id":"","url":"https://api.github.com/users/osahyoun","html_url":"https://github.com/osahyoun","followers_url":"https://api.github.com/users/osahyoun/followers","following_url":"https://api.github.com/users/osahyoun/following{/other_user}","gists_url":"https://api.github.com/users/osahyoun/gists{/gist_id}","starred_url":"https://api.github.com/users/osahyoun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osahyoun/subscriptions","organizations_url":"https://api.github.com/users/osahyoun/orgs","repos_url":"https://api.github.com/users/osahyoun/repos","events_url":"https://api.github.com/users/osahyoun/events{/privacy}","received_events_url":"https://api.github.com/users/osahyoun/received_events","type":"User","site_admin":false},"created_at":"2015-11-27T16:07:41Z","updated_at":"2015-11-27T16:07:41Z","body":":100:  Lovely, readable specs. "}}