Forráskód Böngészése

AMBARI-804. Fix routing issues with Admin pages. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/AMBARI-666@1393847 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 éve
szülő
commit
be3cbbf1fa

+ 2 - 0
AMBARI-666-CHANGES.txt

@@ -224,6 +224,8 @@ AMBARI-666 branch (unreleased changes)
 
   BUG FIXES
 
+  AMBARI-804. Fix routing issues with Admin pages. (yusaku)
+
   AMBARI-798. Fix import issue due to move of Predicate class. (hitesh)
 
   AMBARI-780. Make FSM related changes for heartbeat handler. (hitesh)

+ 1 - 1
ambari-web/app/models/form.js

@@ -118,7 +118,7 @@ App.Form = Em.View.extend({
       });
     } else {
       if (this.get('className'))
-        App.store.createRecord(App.User, this.getValues())
+        App.store.createRecord(this.get('className'), this.getValues())
       else
         console.log("Please define class name for your form " + this.constructor);
     }

+ 1 - 1
ambari-web/app/views/main/admin/user/edit.js

@@ -24,7 +24,7 @@ App.MainAdminUserEditView = Em.View.extend({
   create: function(event){
     var form = this.get("userForm");
     if(form.isValid() && form.save()) {
-      App.router.transitionTo("all");
+      App.router.transitionTo("allUsers");
     }
   },
 

+ 33 - 33
ambari-web/test/main/dashboard_test.js

@@ -1,34 +1,34 @@
-/**
- * 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.
- */
-
-var App = require('app');
-
-require('models/alert'); 
-App.Alert.FIXTURES = [{ status: 'ok' }, { status: 'corrupt' }, { status: 'corrupt',}];
-require('controllers/main/dashboard');
- 
-describe('MainDashboard', function () {
- 
-  var controller = App.MainDashboardController.create();
-  
-  describe('#alertsCount', function () {
-    it('should return 2 if 2 alerts has status corrupt', function () {
-        expect(controller.get('alertsCount')).to.equal(2);
-    })
-  })
+/**
+ * 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.
+ */
+
+var App = require('app');
+
+require('models/alert'); 
+App.Alert.FIXTURES = [{ status: 'ok' }, { status: 'corrupt' }, { status: 'corrupt',}];
+require('controllers/main/dashboard');
+ 
+describe('MainDashboard', function () {
+ 
+  var controller = App.MainDashboardController.create();
+  
+  describe('#alertsCount', function () {
+    it('should return 2 if 2 alerts has status corrupt', function () {
+        expect(controller.get('alertsCount')).to.equal(2);
+    })
+  })
 })

+ 48 - 48
ambari-web/test/main/host/details_test.js

@@ -1,49 +1,49 @@
-/**
- * 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.
- */
- var Ember = require('ember');
- var App = require('app');
- 
-require('controllers/main/host/details');
-
-describe('MainHostdetails', function () {
-  var controller = App.MainHostDetailsController.create();
-  controller.content = Ember.Object.create({});
-   
-  describe('#setBack(value)', function () {
-    it('should return true if value is true', function () {
-      controller.setBack(true);
-      expect(controller.get('isFromHosts')).to.equal(true);
-    })
-  }),
-  describe('#workStatus positive', function () {
-    it('should return true if workstatus is true', function () {
-      controller.content.set('workStatus',true);   
-      expect(controller.get('isStarting')).to.equal(true);
-      }),
-    it('should return false if workStatus is true', function () {
-      expect(controller.get('isStopping')).to.equal(false);
-    })
-    it('should return false if workstatus is false', function () {
-      controller.content.set('workStatus',false);   
-      expect(controller.get('isStarting')).to.equal(false);
-      }),
-    it('should return true if workStatus is false', function () {
-      expect(controller.get('isStopping')).to.equal(true);
-    })
-  })
+/**
+ * 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.
+ */
+ var Ember = require('ember');
+ var App = require('app');
+ 
+require('controllers/main/host/details');
+
+describe('MainHostdetails', function () {
+  var controller = App.MainHostDetailsController.create();
+  controller.content = Ember.Object.create({});
+   
+  describe('#setBack(value)', function () {
+    it('should return true if value is true', function () {
+      controller.setBack(true);
+      expect(controller.get('isFromHosts')).to.equal(true);
+    })
+  }),
+  describe('#workStatus positive', function () {
+    it('should return true if workstatus is true', function () {
+      controller.content.set('workStatus',true);   
+      expect(controller.get('isStarting')).to.equal(true);
+      }),
+    it('should return false if workStatus is true', function () {
+      expect(controller.get('isStopping')).to.equal(false);
+    })
+    it('should return false if workstatus is false', function () {
+      controller.content.set('workStatus',false);   
+      expect(controller.get('isStarting')).to.equal(false);
+      }),
+    it('should return true if workStatus is false', function () {
+      expect(controller.get('isStopping')).to.equal(true);
+    })
+  })
 })

+ 84 - 84
ambari-web/test/main/host_test.js

@@ -1,84 +1,84 @@
-/**
- * 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.
- */
-
-var App = require('app');
-require('models/cluster');
-require('models/service');
-require('models/pagination');
-require('controllers/main/host');
-
-
-describe('MainHostController', function () {
-    describe('#sortByName()', function () {
-        it('should change isSort value to true', function () {
-            var mainHostController = App.MainHostController.create();
-            mainHostController.set('isSort', false);
-            mainHostController.sortByName();
-            expect(mainHostController.get('isSort')).to.equal(true);
-        });
-
-
-        it('should inverse sortingAsc ', function () {
-            var mainHostController = App.MainHostController.create();
-            mainHostController.set('sortingAsc', false);
-            mainHostController.sortByName();
-            expect(mainHostController.get('sortingAsc')).to.equal(true);
-            mainHostController.sortByName();
-            expect(mainHostController.get('sortingAsc')).to.equal(false);
-        })
-    });
-
-
-    describe('#showNextPage, #showPreviousPage()', function () {
-        it('should change rangeStart according to page', function () {
-            var mainHostController = App.MainHostController.create();
-            mainHostController.set('pageSize', 3);
-            mainHostController.showNextPage();
-            expect(mainHostController.get('rangeStart')).to.equal(3);
-            mainHostController.showPreviousPage();
-            expect(mainHostController.get('rangeStart')).to.equal(0);
-        })
-    });
-
-
-    describe('#sortClass()', function () {
-        it('should return \'icon-arrow-down\' if sortingAsc is true', function () {
-            var mainHostController = App.MainHostController.create({});
-            mainHostController.set('sortingAsc', true);
-            expect(mainHostController.get('sortClass')).to.equal('icon-arrow-down');
-        });
-        it('should return \'icon-arrow-up\' if sortingAsc is false', function () {
-            var mainHostController = App.MainHostController.create({});
-            mainHostController.set('sortingAsc', false);
-            expect(mainHostController.get('sortClass')).to.equal('icon-arrow-up');
-        })
-    });
-
-
-    describe('#allChecked', function () {
-        it('should fill selectedhostsids array', function () {
-            var mainHostController = App.MainHostController.create();
-            mainHostController.set('allChecked', false);
-            expect(mainHostController.get('selectedHostsIds').length).to.equal(0);
-            mainHostController.set('allChecked', true);
-            expect(!!(mainHostController.get('selectedHostsIds').length)).to.equal(true);
-        })
-    });
-
-
-});
+/**
+ * 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.
+ */
+
+var App = require('app');
+require('models/cluster');
+require('models/service');
+require('models/pagination');
+require('controllers/main/host');
+
+
+describe('MainHostController', function () {
+    describe('#sortByName()', function () {
+        it('should change isSort value to true', function () {
+            var mainHostController = App.MainHostController.create();
+            mainHostController.set('isSort', false);
+            mainHostController.sortByName();
+            expect(mainHostController.get('isSort')).to.equal(true);
+        });
+
+
+        it('should inverse sortingAsc ', function () {
+            var mainHostController = App.MainHostController.create();
+            mainHostController.set('sortingAsc', false);
+            mainHostController.sortByName();
+            expect(mainHostController.get('sortingAsc')).to.equal(true);
+            mainHostController.sortByName();
+            expect(mainHostController.get('sortingAsc')).to.equal(false);
+        })
+    });
+
+
+    describe('#showNextPage, #showPreviousPage()', function () {
+        it('should change rangeStart according to page', function () {
+            var mainHostController = App.MainHostController.create();
+            mainHostController.set('pageSize', 3);
+            mainHostController.showNextPage();
+            expect(mainHostController.get('rangeStart')).to.equal(3);
+            mainHostController.showPreviousPage();
+            expect(mainHostController.get('rangeStart')).to.equal(0);
+        })
+    });
+
+
+    describe('#sortClass()', function () {
+        it('should return \'icon-arrow-down\' if sortingAsc is true', function () {
+            var mainHostController = App.MainHostController.create({});
+            mainHostController.set('sortingAsc', true);
+            expect(mainHostController.get('sortClass')).to.equal('icon-arrow-down');
+        });
+        it('should return \'icon-arrow-up\' if sortingAsc is false', function () {
+            var mainHostController = App.MainHostController.create({});
+            mainHostController.set('sortingAsc', false);
+            expect(mainHostController.get('sortClass')).to.equal('icon-arrow-up');
+        })
+    });
+
+
+    describe('#allChecked', function () {
+        it('should fill selectedhostsids array', function () {
+            var mainHostController = App.MainHostController.create();
+            mainHostController.set('allChecked', false);
+            expect(mainHostController.get('selectedHostsIds').length).to.equal(0);
+            mainHostController.set('allChecked', true);
+            expect(!!(mainHostController.get('selectedHostsIds').length)).to.equal(true);
+        })
+    });
+
+
+});

+ 163 - 163
ambari-web/test/utils/form_field_test.js

@@ -1,164 +1,164 @@
-/**
- * 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.
- */
-
-var App = require('app');
-require('models/form');
-
-
-/*
- * formField.isValid property doesn't update correctly, so I have to work with errorMessage property
- */
-describe('App.FormField', function () {
-
-  describe('#validate()', function () {
-    /*DIGITS TYPE*/
-    it('123456789 is correct digits', function () {
-      var formField = App.FormField.create();
-      formField.set('displayType', 'digits');
-      formField.set('value', 123456789);
-      formField.validate();
-      expect(formField.get('errorMessage') === '').to.equal(true);
-    })
-    it('"a33bc" is incorrect digits', function () {
-      var formField = App.FormField.create();
-      formField.set('displayType', 'digits');
-      formField.set('value', 'a33bc');
-      formField.validate();
-      expect(formField.get('errorMessage') === '').to.equal(false);
-    })
-    /*DIGITS TYPE END*/
-    /*NUMBER TYPE*/
-    it('+1234 is correct number', function () {
-      var formField = App.FormField.create();
-      formField.set('displayType', 'number');
-      formField.set('value', '+1234');
-      formField.validate();
-      expect(formField.get('errorMessage') === '').to.equal(true);
-    })
-    it('-1234 is correct number', function () {
-      var formField = App.FormField.create();
-      formField.set('displayType', 'number');
-      formField.set('value', '-1234');
-      formField.validate();
-      expect(formField.get('errorMessage') === '').to.equal(true);
-    })
-    it('-1.23.6 is incorrect number', function () {
-      var formField = App.FormField.create();
-      formField.set('displayType', 'number');
-      formField.set('value', '-1.23.6');
-      formField.validate();
-      expect(formField.get('errorMessage') === '').to.equal(false);
-    })
-    it('+1.6 is correct number', function () {
-      var formField = App.FormField.create();
-      formField.set('displayType', 'number');
-      formField.set('value', +1.6);
-      formField.validate();
-      expect(formField.get('errorMessage') === '').to.equal(true);
-    })
-    it('-1.6 is correct number', function () {
-      var formField = App.FormField.create();
-      formField.set('displayType', 'number');
-      formField.set('value', -1.6);
-      formField.validate();
-      expect(formField.get('errorMessage') === '').to.equal(true);
-    })
-    it('1.6 is correct number', function () {
-      var formField = App.FormField.create();
-      formField.set('displayType', 'number');
-      formField.set('value', 1.6);
-      formField.validate();
-      expect(formField.get('errorMessage') === '').to.equal(true);
-    })
-    it('-.356 is correct number', function () {
-      var formField = App.FormField.create();
-      formField.set('displayType', 'number');
-      formField.set('value', '-.356');
-      formField.validate();
-      expect(formField.get('errorMessage') === '').to.equal(true);
-    })
-    it('+.356 is correct number', function () {
-      var formField = App.FormField.create();
-      formField.set('displayType', 'number');
-      formField.set('value', '+.356');
-      formField.validate();
-      expect(formField.get('errorMessage') === '').to.equal(true);
-    })
-    it('-1. is incorrect number', function () {
-      var formField = App.FormField.create();
-      formField.set('displayType', 'number');
-      formField.set('value', '-1.');
-      formField.validate();
-      expect(formField.get('errorMessage') === '').to.equal(false);
-    })
-    it('+1. is incorrect number', function () {
-      var formField = App.FormField.create();
-      formField.set('displayType', 'number');
-      formField.set('value', '+1.');
-      formField.validate();
-      expect(formField.get('errorMessage') === '').to.equal(false);
-    })
-    it('1. is incorrect number', function () {
-      var formField = App.FormField.create();
-      formField.set('displayType', 'number');
-      formField.set('value', '1.');
-      formField.validate();
-      expect(formField.get('errorMessage') === '').to.equal(false);
-    })
-    it('-1,23,6 is incorrect number', function () {
-      var formField = App.FormField.create();
-      formField.set('displayType', 'number');
-      formField.set('value', '-1,23,6');
-      formField.validate();
-      expect(formField.get('errorMessage') === '').to.equal(false);
-    })
-    it('-1234567890 is correct number', function () {
-      var formField = App.FormField.create();
-      formField.set('displayType', 'number');
-      formField.set('value', '-1234567890');
-      formField.validate();
-      expect(formField.get('errorMessage') === '').to.equal(true);
-    })
-    it('+1234567890 is correct number', function () {
-      var formField = App.FormField.create();
-      formField.set('displayType', 'number');
-      formField.set('value', '+1234567890');
-      formField.validate();
-      expect(formField.get('errorMessage') === '').to.equal(true);
-    })
-    it('123eed is incorrect number', function () {
-      var formField = App.FormField.create();
-      formField.set('displayType', 'number');
-      formField.set('value', '123eed');
-      formField.validate();
-      expect(formField.get('errorMessage') === '').to.equal(false);
-    })
-    /*NUMBER TYPE END*/
-    /*REQUIRE*/
-    it('Required field shouldn\'t be empty', function () {
-      var formField = App.FormField.create();
-      formField.set('displayType', 'string');
-      formField.set('value', '');
-      formField.set('isRequired', true);
-      formField.validate();
-      expect(formField.get('errorMessage') === '').to.equal(false);
-    })
-    /*REQUIRE END*/
-
-  })
+/**
+ * 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.
+ */
+
+var App = require('app');
+require('models/form');
+
+
+/*
+ * formField.isValid property doesn't update correctly, so I have to work with errorMessage property
+ */
+describe('App.FormField', function () {
+
+  describe('#validate()', function () {
+    /*DIGITS TYPE*/
+    it('123456789 is correct digits', function () {
+      var formField = App.FormField.create();
+      formField.set('displayType', 'digits');
+      formField.set('value', 123456789);
+      formField.validate();
+      expect(formField.get('errorMessage') === '').to.equal(true);
+    })
+    it('"a33bc" is incorrect digits', function () {
+      var formField = App.FormField.create();
+      formField.set('displayType', 'digits');
+      formField.set('value', 'a33bc');
+      formField.validate();
+      expect(formField.get('errorMessage') === '').to.equal(false);
+    })
+    /*DIGITS TYPE END*/
+    /*NUMBER TYPE*/
+    it('+1234 is correct number', function () {
+      var formField = App.FormField.create();
+      formField.set('displayType', 'number');
+      formField.set('value', '+1234');
+      formField.validate();
+      expect(formField.get('errorMessage') === '').to.equal(true);
+    })
+    it('-1234 is correct number', function () {
+      var formField = App.FormField.create();
+      formField.set('displayType', 'number');
+      formField.set('value', '-1234');
+      formField.validate();
+      expect(formField.get('errorMessage') === '').to.equal(true);
+    })
+    it('-1.23.6 is incorrect number', function () {
+      var formField = App.FormField.create();
+      formField.set('displayType', 'number');
+      formField.set('value', '-1.23.6');
+      formField.validate();
+      expect(formField.get('errorMessage') === '').to.equal(false);
+    })
+    it('+1.6 is correct number', function () {
+      var formField = App.FormField.create();
+      formField.set('displayType', 'number');
+      formField.set('value', +1.6);
+      formField.validate();
+      expect(formField.get('errorMessage') === '').to.equal(true);
+    })
+    it('-1.6 is correct number', function () {
+      var formField = App.FormField.create();
+      formField.set('displayType', 'number');
+      formField.set('value', -1.6);
+      formField.validate();
+      expect(formField.get('errorMessage') === '').to.equal(true);
+    })
+    it('1.6 is correct number', function () {
+      var formField = App.FormField.create();
+      formField.set('displayType', 'number');
+      formField.set('value', 1.6);
+      formField.validate();
+      expect(formField.get('errorMessage') === '').to.equal(true);
+    })
+    it('-.356 is correct number', function () {
+      var formField = App.FormField.create();
+      formField.set('displayType', 'number');
+      formField.set('value', '-.356');
+      formField.validate();
+      expect(formField.get('errorMessage') === '').to.equal(true);
+    })
+    it('+.356 is correct number', function () {
+      var formField = App.FormField.create();
+      formField.set('displayType', 'number');
+      formField.set('value', '+.356');
+      formField.validate();
+      expect(formField.get('errorMessage') === '').to.equal(true);
+    })
+    it('-1. is incorrect number', function () {
+      var formField = App.FormField.create();
+      formField.set('displayType', 'number');
+      formField.set('value', '-1.');
+      formField.validate();
+      expect(formField.get('errorMessage') === '').to.equal(false);
+    })
+    it('+1. is incorrect number', function () {
+      var formField = App.FormField.create();
+      formField.set('displayType', 'number');
+      formField.set('value', '+1.');
+      formField.validate();
+      expect(formField.get('errorMessage') === '').to.equal(false);
+    })
+    it('1. is incorrect number', function () {
+      var formField = App.FormField.create();
+      formField.set('displayType', 'number');
+      formField.set('value', '1.');
+      formField.validate();
+      expect(formField.get('errorMessage') === '').to.equal(false);
+    })
+    it('-1,23,6 is incorrect number', function () {
+      var formField = App.FormField.create();
+      formField.set('displayType', 'number');
+      formField.set('value', '-1,23,6');
+      formField.validate();
+      expect(formField.get('errorMessage') === '').to.equal(false);
+    })
+    it('-1234567890 is correct number', function () {
+      var formField = App.FormField.create();
+      formField.set('displayType', 'number');
+      formField.set('value', '-1234567890');
+      formField.validate();
+      expect(formField.get('errorMessage') === '').to.equal(true);
+    })
+    it('+1234567890 is correct number', function () {
+      var formField = App.FormField.create();
+      formField.set('displayType', 'number');
+      formField.set('value', '+1234567890');
+      formField.validate();
+      expect(formField.get('errorMessage') === '').to.equal(true);
+    })
+    it('123eed is incorrect number', function () {
+      var formField = App.FormField.create();
+      formField.set('displayType', 'number');
+      formField.set('value', '123eed');
+      formField.validate();
+      expect(formField.get('errorMessage') === '').to.equal(false);
+    })
+    /*NUMBER TYPE END*/
+    /*REQUIRE*/
+    it('Required field shouldn\'t be empty', function () {
+      var formField = App.FormField.create();
+      formField.set('displayType', 'string');
+      formField.set('value', '');
+      formField.set('isRequired', true);
+      formField.validate();
+      expect(formField.get('errorMessage') === '').to.equal(false);
+    })
+    /*REQUIRE END*/
+
+  })
 })