Skip to content

Commit c029dc7

Browse files
committed
Fixed unit-test.
1 parent 533854a commit c029dc7

3 files changed

Lines changed: 30 additions & 14 deletions

File tree

test/controllers/default.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,8 +549,8 @@ function viewViews() {
549549
assert.ok(output.contains('<div>4</div><div>4</div><div>FOREACH</div>'), name + 'foreach');
550550
assert.ok(output.contains('<div>3</div><div>3</div><div></div><div>C:10</div><div>C:11</div><div>C:12</div>'), name + 'foreach - nested');
551551
assert.ok(output.contains('<INLINE>5</INLINE>'), name + 'Inline assign value');
552-
assert.ok(output.contains('var d="$\'"'), name + 'JS script special chars 1');
553-
assert.ok(output.contains("var e='$\\'';"), name + "JS script special chars 2");
552+
assert.ok(output.contains(',d="$\'"'), name + 'JS script special chars 1');
553+
assert.ok(output.contains(",e='$\\'',"), name + "JS script special chars 2");
554554
assert.ok(output.contains('<script type="text/template"><textarea>\na</textarea>a</script>') || output.contains('<script type="text/template"><textarea>\r\na</textarea>a</script>'), name + ' minify html');
555555
assert.ok(output.contains('#tag-encode&lt;b&gt;A&lt;/b&gt;#'), name + 'encode value');
556556
assert.ok(output.contains('#tag-raw<b>A</b>#'), name + 'raw value');

test/test-framework-debug.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ function test_view_functions(next) {
7979

8080
if (error)
8181
assert.ok(false, 'test_view_functions: ' + error.toString());
82-
8382
assert.ok(data === '{"r":true}', 'json');
8483
next();
8584
});
@@ -754,7 +753,7 @@ function test_routing(next) {
754753
utils.request(url + 'merge-blocks-a.js', [], function(error, data, code, headers) {
755754
if (error)
756755
throw error;
757-
assert(data.indexOf('var common=true;var a=true;') !== -1, 'merge blocks - A');
756+
assert(data.indexOf('var common=true,a=true;') !== -1, 'merge blocks - A');
758757
complete();
759758
});
760759
});
@@ -763,7 +762,7 @@ function test_routing(next) {
763762
utils.request(url + 'merge-blocks-b.js', [], function(error, data, code, headers) {
764763
if (error)
765764
throw error;
766-
assert(data.indexOf('var common=true;var b=true;') !== -1, 'merge blocks - B');
765+
assert(data.indexOf('var common=true,b=true;') !== -1, 'merge blocks - B');
767766
complete();
768767
});
769768
});
@@ -772,7 +771,7 @@ function test_routing(next) {
772771
utils.request(url + 'blocks-a.js', [], function(error, data, code, headers) {
773772
if (error)
774773
throw error;
775-
assert(data.indexOf('var common=true;var a=true;') !== -1, 'mapping blocks - A');
774+
assert(data.indexOf('var common=true,a=true;') !== -1, 'mapping blocks - A');
776775
complete();
777776
});
778777
});
@@ -781,7 +780,7 @@ function test_routing(next) {
781780
utils.request(url + 'blocks-b.js', [], function(error, data, code, headers) {
782781
if (error)
783782
throw error;
784-
assert(data.indexOf('var common=true;var b=true;') !== -1, 'mapping blocks - B');
783+
assert(data.indexOf('var common=true,b=true;') !== -1, 'mapping blocks - B');
785784
complete();
786785
});
787786
});
@@ -790,7 +789,7 @@ function test_routing(next) {
790789
utils.request(url + 'blocks-c.js', [], function(error, data, code, headers) {
791790
if (error)
792791
throw error;
793-
assert(data.indexOf('var common=true;var a=true;var b=true;') !== -1, 'mapping blocks - C');
792+
assert(data.indexOf('var common=true,a=true,b=true;') !== -1, 'mapping blocks - C');
794793
complete();
795794
});
796795
});

test/test-framework-release.js

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ function test_view_functions(next) {
7979

8080
if (error)
8181
assert.ok(false, 'test_view_functions: ' + error.toString());
82-
8382
assert.ok(data === '{"r":true}', 'json');
8483
next();
8584
});
@@ -397,6 +396,24 @@ function test_routing(next) {
397396
});
398397
});
399398

399+
async.await('prefix -- 1', function(complete) {
400+
utils.request(url + 'prefix1/test/', ['get'], function(error, data) {
401+
if (error)
402+
throw error;
403+
assert.ok(data === 'PREFIX1TEST', 'Group + Prefix 1');
404+
complete();
405+
});
406+
});
407+
408+
async.await('prefix -- 2', function(complete) {
409+
utils.request(url + 'prefix2/test/', ['get'], function(error, data) {
410+
if (error)
411+
throw error;
412+
assert.ok(data === 'PREFIX2TEST', 'Group + Prefix 2');
413+
complete();
414+
});
415+
});
416+
400417
async.await('package/', function(complete) {
401418
utils.request(url + 'package/', ['get'], function(error, data, code, headers) {
402419
if (error)
@@ -736,7 +753,7 @@ function test_routing(next) {
736753
utils.request(url + 'merge-blocks-a.js', [], function(error, data, code, headers) {
737754
if (error)
738755
throw error;
739-
assert(data.indexOf('var common=true;var a=true;') !== -1, 'merge blocks - A');
756+
assert(data.indexOf('var common=true,a=true;') !== -1, 'merge blocks - A');
740757
complete();
741758
});
742759
});
@@ -745,7 +762,7 @@ function test_routing(next) {
745762
utils.request(url + 'merge-blocks-b.js', [], function(error, data, code, headers) {
746763
if (error)
747764
throw error;
748-
assert(data.indexOf('var common=true;var b=true;') !== -1, 'merge blocks - B');
765+
assert(data.indexOf('var common=true,b=true;') !== -1, 'merge blocks - B');
749766
complete();
750767
});
751768
});
@@ -754,7 +771,7 @@ function test_routing(next) {
754771
utils.request(url + 'blocks-a.js', [], function(error, data, code, headers) {
755772
if (error)
756773
throw error;
757-
assert(data.indexOf('var common=true;var a=true;') !== -1, 'mapping blocks - A');
774+
assert(data.indexOf('var common=true,a=true;') !== -1, 'mapping blocks - A');
758775
complete();
759776
});
760777
});
@@ -763,7 +780,7 @@ function test_routing(next) {
763780
utils.request(url + 'blocks-b.js', [], function(error, data, code, headers) {
764781
if (error)
765782
throw error;
766-
assert(data.indexOf('var common=true;var b=true;') !== -1, 'mapping blocks - B');
783+
assert(data.indexOf('var common=true,b=true;') !== -1, 'mapping blocks - B');
767784
complete();
768785
});
769786
});
@@ -772,7 +789,7 @@ function test_routing(next) {
772789
utils.request(url + 'blocks-c.js', [], function(error, data, code, headers) {
773790
if (error)
774791
throw error;
775-
assert(data.indexOf('var common=true;var a=true;var b=true;') !== -1, 'mapping blocks - C');
792+
assert(data.indexOf('var common=true,a=true,b=true;') !== -1, 'mapping blocks - C');
776793
complete();
777794
});
778795
});

0 commit comments

Comments
 (0)