climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r1495286 - /incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/ObservationSelectCtrlTest.js
Date Fri, 21 Jun 2013 04:07:33 GMT
Author: joyce
Date: Fri Jun 21 04:07:33 2013
New Revision: 1495286

URL: http://svn.apache.org/r1495286
Log:
CLIMATE-130 progress - Add addDataSet test

Modified:
    incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/ObservationSelectCtrlTest.js

Modified: incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/ObservationSelectCtrlTest.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/ObservationSelectCtrlTest.js?rev=1495286&r1=1495285&r2=1495286&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/ObservationSelectCtrlTest.js
(original)
+++ incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/ObservationSelectCtrlTest.js
Fri Jun 21 04:07:33 2013
@@ -83,5 +83,22 @@ describe('OCW Controllers', function() {
 				expect(Object.keys(scope.localSelectForm).length).toEqual(0);
 			});
 		});
+
+		it('should initialize the addDatasets function', function() {
+			inject(function($httpBackend, $rootScope, $controller) {
+				$rootScope.baseURL = "http://localhost:8082"
+				$httpBackend.expectJSONP($rootScope.baseURL + '/getPathLeader/?callback=JSON_CALLBACK').
+					respond(200, {'leader': '/usr/local/rcmes'});
+
+				var scope = $rootScope.$new();
+				var ctrl = $controller("ObservationSelectCtrl", {$scope: scope});
+				$httpBackend.flush();
+
+				// Add a bunch of bogus data as a dataset
+				scope.addDataSet();
+
+				expect(scope.datasetCount.length).toBe(1);
+			});
+		});
 	});
 });



Mime
View raw message