@@ -0,0 +1,669 @@
+describe( 'ccLibrary', function () %7B%0A%09beforeEach( function () %7B%0A%09%09module( 'ccApp' );%0A%09%7D );%0A%0A%09it( 'getCountries() query the Geonames.org api for countries data',%0A%09%09inject( function ($httpBackend, $q, ccLibraryService) %7B%0A%09%09%09$httpBackend.when( 'JSONP', 'http://api.geonames.org/countryInfoJSON?callback=JSON_CALLBACK&username=hanoman_sakti' )%0A%09%09%09%09.respond( %7B%0A%09%09%09%09%09geonames: %5B%7Bkey: 0%7D, %7Bkey: 1%7D, %7Bkey: 2%7D%5D%0A%09%09%09%09%7D );%0A%09%09%09var countries;%0A%09%09%09$q.when( ccLibraryService.getCountries() ).then( function (result) %7B%0A%09%09%09%09countries = result.geonames%0A%09%09%09%7D );%0A%0A%09%09%09$httpBackend.flush();%0A%0A%09%09%09expect( countries.length ).toBe( 3 );%0A%0A%09%09%09$httpBackend.verifyNoOutstandingRequest();%0A%09%09%7D ) );%0A%7D );

Test factory.