{"action":"closed","issue":{"url":"https://api.github.com/repos/Swimlane/angular-model-factory/issues/7","labels_url":"https://api.github.com/repos/Swimlane/angular-model-factory/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/Swimlane/angular-model-factory/issues/7/comments","events_url":"https://api.github.com/repos/Swimlane/angular-model-factory/issues/7/events","html_url":"https://github.com/Swimlane/angular-model-factory/issues/7","id":50265256,"number":7,"title":"Task: Add unit tests","user":{"login":"juristr","id":542458,"avatar_url":"https://avatars.githubusercontent.com/u/542458?v=3","gravatar_id":"","url":"https://api.github.com/users/juristr","html_url":"https://github.com/juristr","followers_url":"https://api.github.com/users/juristr/followers","following_url":"https://api.github.com/users/juristr/following{/other_user}","gists_url":"https://api.github.com/users/juristr/gists{/gist_id}","starred_url":"https://api.github.com/users/juristr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juristr/subscriptions","organizations_url":"https://api.github.com/users/juristr/orgs","repos_url":"https://api.github.com/users/juristr/repos","events_url":"https://api.github.com/users/juristr/events{/privacy}","received_events_url":"https://api.github.com/users/juristr/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Swimlane/angular-model-factory/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":{"login":"juristr","id":542458,"avatar_url":"https://avatars.githubusercontent.com/u/542458?v=3","gravatar_id":"","url":"https://api.github.com/users/juristr","html_url":"https://github.com/juristr","followers_url":"https://api.github.com/users/juristr/followers","following_url":"https://api.github.com/users/juristr/following{/other_user}","gists_url":"https://api.github.com/users/juristr/gists{/gist_id}","starred_url":"https://api.github.com/users/juristr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juristr/subscriptions","organizations_url":"https://api.github.com/users/juristr/orgs","repos_url":"https://api.github.com/users/juristr/repos","events_url":"https://api.github.com/users/juristr/events{/privacy}","received_events_url":"https://api.github.com/users/juristr/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2014-11-27T08:18:18Z","updated_at":"2015-07-22T19:57:57Z","closed_at":"2015-07-22T19:57:57Z","body":"If I'm going to use this in production I'd like to have some test running on it to make we don't break existing features with future updates :wink:. It's better to add those tests on the lib here rather than on my side...so\r\n\r\n..I'm currently working on the test setup ([see branch](https://github.com/juristr/model-factory/tree/test-setup)) with karma and will submit a pull request once finished.\r\n\r\n**Setup**\r\n\r\n- [x] Setup infrastructure with karma\r\n- [x] Integrate with [https://travis-ci.org/]() to have automated builds for pull requests and new commits. [See build](https://travis-ci.org/juristr/model-factory)\r\n\r\n**Write some tests**  :smile:\r\n\r\n- [x] instantiation of a model/list\r\n- [x] executing different kind of query()\r\n- [x] executing different kind of get(..)\r\n- [x] executing persists with `$save(..)`\r\n- [x] executing deletions\r\n- [x] correct interpretation of map definitions\r\n- [x] default values\r\n- [x] before/after request interceptors\r\n- [ ] caching and cache invalidation\r\n- [x] custom actions\r\n- [x] list helpers\r\n- [x] instance helpers\r\n- [x] static method definitions\r\n- [x] auto-updating of lists when calling `$destroy` etc..\r\n\r\n**Things to clarify**\r\n\r\n- [x] creating a new empty model list doesn't work: `new PersonModel.List()`. Intended behavior or bug? IMHO it should create an empty list.\r\n- [x] `AnimalsModel.get({ id: id });` results in a call to `api/zoo/?id=345234` rather than `api/zoo/345234` as described in the README. Which one is the intended behavior? I'd opt for the the first one, meaning it should result in `api/zoo?id=12314` if you call `.get(..)` passing an object.\r\n- [ ] a custom defined action doesn't correctly include the params. See skipped test `xit('should allow to specify query parameters'`"}}