climate-commits mailing list archives

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

URL: http://svn.apache.org/r1494246
Log:
CLIMATE-122 progress - Add removeDataset test

Added:
    incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/DatasetDisplayCtrlTest.js

Added: incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/DatasetDisplayCtrlTest.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/DatasetDisplayCtrlTest.js?rev=1494246&view=auto
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/DatasetDisplayCtrlTest.js
(added)
+++ incubator/climate/trunk/rcmet/src/main/ui/test/unit/controllers/DatasetDisplayCtrlTest.js
Tue Jun 18 18:50:04 2013
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http: *www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+**/
+
+'use strict';
+
+describe('OCW Controllers', function() {
+
+	beforeEach(module('ocw.controllers'));
+	beforeEach(module('ocw.services'));
+
+	describe('DatasetDisplayCtrl', function() {
+		it('should initialize the removeDataset function', function() {
+			inject(function($rootScope, $controller) {
+				var scope = $rootScope.$new();
+				var ctrl = $controller("DatasetDisplayCtrl", {$scope: scope});
+
+				scope.datasets.push(1);
+				scope.datasets.push(2);
+
+				expect(scope.datasets[0]).toBe(1);
+
+				scope.removeDataset(0);
+
+				expect(scope.datasets[0]).toBe(2);
+			});
+		});
+	});
+});



Mime
View raw message