{"action":"created","issue":{"url":"https://api.github.com/repos/johnpapa/angular-styleguide/issues/664","repository_url":"https://api.github.com/repos/johnpapa/angular-styleguide","labels_url":"https://api.github.com/repos/johnpapa/angular-styleguide/issues/664/labels{/name}","comments_url":"https://api.github.com/repos/johnpapa/angular-styleguide/issues/664/comments","events_url":"https://api.github.com/repos/johnpapa/angular-styleguide/issues/664/events","html_url":"https://github.com/johnpapa/angular-styleguide/issues/664","id":134249839,"number":664,"title":"Karma / Jasmin unit test problems","user":{"login":"ibbatta","id":4375285,"avatar_url":"https://avatars.githubusercontent.com/u/4375285?v=3","gravatar_id":"","url":"https://api.github.com/users/ibbatta","html_url":"https://github.com/ibbatta","followers_url":"https://api.github.com/users/ibbatta/followers","following_url":"https://api.github.com/users/ibbatta/following{/other_user}","gists_url":"https://api.github.com/users/ibbatta/gists{/gist_id}","starred_url":"https://api.github.com/users/ibbatta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibbatta/subscriptions","organizations_url":"https://api.github.com/users/ibbatta/orgs","repos_url":"https://api.github.com/users/ibbatta/repos","events_url":"https://api.github.com/users/ibbatta/events{/privacy}","received_events_url":"https://api.github.com/users/ibbatta/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-02-17T11:00:56Z","updated_at":"2016-02-17T11:47:04Z","closed_at":null,"body":"Hi Johnpapa,\r\n\r\nfirst of all let me thank you for this amazing guide (I really love it)!! Apologize for my awful english..\r\nI am learning how to write test for the first time and I have some problems to use karma / jasmine test in  a project of mine.\r\n\r\nThis is the controller\r\n\r\n```\r\n(function() {\r\n  'use strict';\r\n\r\n  angular\r\n    .module('name-module')\r\n    .controller('NameCtrl', NameCtrl);\r\n\r\n  function NameCtrl(){\r\n      \r\n    var vm = this;\r\n\r\n    vm.country = null;\r\n    \r\n }\r\n})();\r\n```\r\n\r\nand this is the spec file\r\n\r\n```\r\ndescribe('NameCtrl functionality', function() {\r\n\r\n  beforeEach(module('name-module'));\r\n\r\n  var $controller;\r\n\r\n  beforeEach(inject(function(_$controller_){\r\n    $controller = _$controller_;\r\n  }));\r\n\r\n  describe('Test controller', function() {\r\n    it('Verify if country is null', function() {\r\n      \r\n      var $scope = {};\r\n      var vm = $controller('NameCtrl', { $scope: $scope });\r\n      \r\n      expect(vm.country).toBe(null);\r\n\r\n    });\r\n  });\r\n\r\n});\r\n```\r\n\r\nThe console log return me this:\r\n\r\n> TypeError: undefined is not a constructor (evaluating '$controller('NameCtrl', { $scope: $scope })')\r\n\r\nWhat's wrong? (sorry for this issue, maybe is a silly request but I don't understand how to test with this styleguide)"},"comment":{"url":"https://api.github.com/repos/johnpapa/angular-styleguide/issues/comments/185168624","html_url":"https://github.com/johnpapa/angular-styleguide/issues/664#issuecomment-185168624","issue_url":"https://api.github.com/repos/johnpapa/angular-styleguide/issues/664","id":185168624,"user":{"login":"bampakoa","id":7170892,"avatar_url":"https://avatars.githubusercontent.com/u/7170892?v=3","gravatar_id":"","url":"https://api.github.com/users/bampakoa","html_url":"https://github.com/bampakoa","followers_url":"https://api.github.com/users/bampakoa/followers","following_url":"https://api.github.com/users/bampakoa/following{/other_user}","gists_url":"https://api.github.com/users/bampakoa/gists{/gist_id}","starred_url":"https://api.github.com/users/bampakoa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bampakoa/subscriptions","organizations_url":"https://api.github.com/users/bampakoa/orgs","repos_url":"https://api.github.com/users/bampakoa/repos","events_url":"https://api.github.com/users/bampakoa/events{/privacy}","received_events_url":"https://api.github.com/users/bampakoa/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T11:47:04Z","updated_at":"2016-02-17T11:47:04Z","body":"Could you test without injecting the controller?"}}