I'm trying to do unit tests for my AngularJS app, but jasmine just do not see the controller, though it's registered in global namespace: ReferenceError: RequestsController is not defined. Gem is https://github.com/searls/jasmine-rails
app/assets/javascripts/requests.js.coffee:
@RequestsController = ($scope) ->
$scope.entries = [
{type: "first"},
{type: "second"}
]
spec/javascripts/support/jasmine.yml:
src_dir: "app/assets/javascripts"
src_files:
- "app/assets/javascripts/requests.js.coffee"
spec_files:
- "**/*[Ss]pec.{js,coffee}"
spec/javascripts/helpers/spec_helper.coffee:
#= require angular
#= require angular-mocks
spec/javascripts/requests_spec.coffee:
#= require helpers/spec_helper
describe 'RequestsCtrl', ->
it 'have entries of request types', ->
scope = {}
ctrl = new RequestsController(scope)
expect(scope.entries.length).toBe(2);