You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This should produce a better error!
I have problem with $resource and arrays. I have forked angular-seed
to test my problem in isolation:
https://github.com/witoldsz/resource-query-arrays
Controller:
function MyCtrl1($resource) {
var Item = $resource('items')
this.items = Item.query();
}
MyCtrl1.$inject = ['$resource'];
Scenario:
describe('MyCtrl1', function() {
var scope, browser, xhr, myCtrl1;
beforeEach(function(){
scope = angular.scope();
browser = scope.$service('$browser');
xhr = browser.xhr;
});
it('should ....', function() {
xhr.expectGET('items').respond(['item1','item2','item3']);
myCtrl1 = scope.$new(MyCtrl1);
xhr.flush();
expect(myCtrl1.items).toContain('item1');
});
});
Test result:
F.
Total 2 tests (Passed: 1; Fails: 1; Errors: 0) (5.00 ms)
Firefox 4.0 Linux: Run 2 tests (Passed: 1; Fails: 1; Errors 0) (5.00 ms)
MyCtrl1.should .... failed (5.00 ms): Error: Expected [ { 0 : 'i',
1 : 't', 2 : 'e', 3 : 'm', 4 : '1', $get : Function, $save : Function,
$query : Function, $remove : Function, $delete : Function }, { 0 :
'i', 1 : 't', 2 : 'e', 3 : 'm', 4 : '2', $get : Function, $save :
Function, $query : Function, $remove : Function, $delete : Function },
{ 0 : 'i', 1 : 't', 2 : 'e', 3 : 'm', 4 : '3', $get : Function, $save
: Function, $query : Function, $remove : Function, $delete : Function
} ] to contain 'item1'.
()@test/unit/controllersSpec.js:17
The text was updated successfully, but these errors were encountered: