[Groonga-commit] groonga/gcs [master] Add tests for auto detection of the search domain

Back to archive index

null+****@clear***** null+****@clear*****
2012年 7月 12日 (木) 13:21:38 JST


SHIMODA Hiroshi	2012-07-12 13:21:38 +0900 (Thu, 12 Jul 2012)

  New Revision: d88eda7fc3f946250d10a75f4ba5742f0499b21c
  https://github.com/groonga/gcs/commit/d88eda7fc3f946250d10a75f4ba5742f0499b21c

  Log:
    Add tests for auto detection of the search domain

  Modified files:
    test/domain.test.js

  Modified: test/domain.test.js (+17 -0)
===================================================================
--- test/domain.test.js    2012-07-12 13:19:02 +0900 (9faf6fe)
+++ test/domain.test.js    2012-07-12 13:21:38 +0900 (b0cd8d3)
@@ -159,6 +159,23 @@ suite('domain', function() {
           var domain = new Domain(request);
         }, /cannot appear in a domain name/);
       });
+
+      test('host vs path', function() {
+        var host = 'doc-test0123-id0123.example.com';
+        var request = { headers: { host: host },
+                        url: '/gcs/test4567' };
+        var domain = new Domain(request);
+        assert.equal(domain.name, 'test0123');
+      });
+
+      test('option vs host vs path', function() {
+        var host = 'doc-test0123-id0123.example.com';
+        var request = { headers: { host: host },
+                        url: '/gcs/test4567',
+                        query: { DomainName: 'test890' } };
+        var domain = new Domain(request);
+        assert.equal(domain.name, 'test890');
+      });
     });
   });
 
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
下载 



Groonga-commit メーリングリストの案内
Back to archive index