In my angular tests, I keep getting Error: Unexpected request: GET 'some/rails/view.html'
I use konacha for testing, which uses mocha instead of jasmine. The project is based on the Rails application, which is the reason for using konacha.
Here is a really simple test example that checks if a controller is defined in an angular application:
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 saw something about $httpBackend.when('GET', /\.html$/).passThrough(); but konacha doesn't seem to have a similar method for passThrough()
These problems always occur with $httpBackend.flush() .
Has anyone beat this issue before? Is there a way to ignore rails template requests so that I can focus on testing the functionality of the controllers?
source share