You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by jo...@apache.org on 2013/06/21 06:07:33 UTC

svn commit: r1495286 - /incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/ObservationSelectCtrlTest.js

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);
+			});
+		});
 	});
 });