In my angular tests I keep getting a Error: Unexpected request: GET 'some/rails/view.html'
I'm using konacha for testing, which uses mocha instead of jasmine. The project is based around a Rails app which is the reason for using konacha.
Here's a really simple sample test that checks if the controller is defined in the Angular app:
describe "ShowAccountCtrl", ->
beforeEach angular.mock.module('APP_NAME')
beforeEach inject(($rootScope, $controller) ->
@scope = $rootScope.$new()
@ctrl = $controller 'ShowAccountCtrl',
$scope: @scope
)
it "should be defined", ->
expect(@ctrl).to.not.be.undefined
I've seen some things about $httpBackend.when('GET', /\.html$/).passThrough();
but konacha doesn't seem to have a similar method to passThrough()
These issues always happen upon a $httpBackend.flush()
.
Has anyone conquered this problem before? Is there a way to ignore requests to rails templates so I can focus on testing functionality of the controllers?