climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r1494253 - /incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/RcmedSelectionCtrlTest.js
Date Tue, 18 Jun 2013 18:50:22 GMT
Author: joyce
Date: Tue Jun 18 18:50:22 2013
New Revision: 1494253

URL: http://svn.apache.org/r1494253
Log:
CLIMATE-125 progress - Add getObservationTimeRange test

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

Modified: incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/RcmedSelectionCtrlTest.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/RcmedSelectionCtrlTest.js?rev=1494253&r1=1494252&r2=1494253&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/RcmedSelectionCtrlTest.js
(original)
+++ incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/RcmedSelectionCtrlTest.js
Tue Jun 18 18:50:22 2013
@@ -66,5 +66,21 @@ describe('OCW Controllers', function() {
 
 			});
 		});
+
+		it('should initialze the getObservationTimeRange function', function() {
+			inject(function($rootScope, $controller, $httpBackend) {
+				$rootScope.baseURL = "http://localhost:8082"
+				$httpBackend.expectJSONP($rootScope.baseURL + '/getObsDatasets?callback=JSON_CALLBACK').
+					respond(200, [{longname: 1}, {longname: 2}]);
+
+				var scope = $rootScope.$new();
+				var ctrl = $controller("RcmedSelectionCtrl", {$scope: scope});
+				$httpBackend.flush();
+
+				expect(scope.getObservationTimeRange(1)).toEqual({'start' : '1989-01-01 00:00:00',
+				                                                    'end' : '2009-12-31 00:00:00'});
+				expect(scope.getObservationTimeRange(-1)).toEqual(false);
+			});
+		});
 	});
 });



Mime
View raw message