[Groonga-commit] groonga/gcs [master] Add test for error response of too long domain name for CreateDomain

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Nov 5 16:19:34 JST 2012


YUKI Hiroshi	2012-11-05 16:19:34 +0900 (Mon, 05 Nov 2012)

  New Revision: 55d3cee374042c89d84f124881b0bd7e153a6569
  https://github.com/groonga/gcs/commit/55d3cee374042c89d84f124881b0bd7e153a6569

  Log:
    Add test for error response of too long domain name for CreateDomain

  Modified files:
    test/api-configuration.test.js

  Modified: test/api-configuration.test.js (+19 -0)
===================================================================
--- test/api-configuration.test.js    2012-11-05 16:18:34 +0900 (2187c04)
+++ test/api-configuration.test.js    2012-11-05 16:19:34 +0900 (4cc78b0)
@@ -132,6 +132,25 @@ suite('Configuration API', function() {
         });
     });
 
+    test('Action=CreateDomain with too long domain name', function(done) {
+      var name = 'abcdefghijklmnopqrstuvwxyz0123456789';
+      utils
+        .get('/?DomainName=' + name + '&Action=CreateDomain&Version=2011-02-01')
+        .next(function(response) {
+          assertValidationErrorResponse(
+            '1 validation error detected: ' +
+              'Value \'' + name + '\' at \'domainName\' failed to satisfy constraint: ' +
+                'Member must have length less than or equal to ' +
+                  Domain.MAXIMUM_NAME_LENGTH,
+            response
+          );
+          done();
+        })
+        .error(function(error) {
+          done(error);
+        });
+    });
+
     test('Action=CreateDomain without domain name', function(done) {
       utils
         .get('/?DomainName=&Action=CreateDomain&Version=2011-02-01')
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index