diff --git a/lib/app/addons/ac/partial.common.js b/lib/app/addons/ac/partial.common.js index 36c8aebb1..6fde404f2 100644 --- a/lib/app/addons/ac/partial.common.js +++ b/lib/app/addons/ac/partial.common.js @@ -63,7 +63,7 @@ YUI.add('mojito-partial-addon', function (Y, NAME) { id = NAME + '::' + (instance.id || '@' + instance.type) + '>render:' + view; - renderer.render(data, instance.type, mojitView, new Y.mojito.OutputBuffer(id, cb), meta); + renderer.render(data, instance, mojitView, new Y.mojito.OutputBuffer(id, cb), meta); }, /** diff --git a/lib/app/autoload/store.server.js b/lib/app/autoload/store.server.js index 94c8078d1..19f0c3ae2 100644 --- a/lib/app/autoload/store.server.js +++ b/lib/app/autoload/store.server.js @@ -743,11 +743,11 @@ YUI.add('mojito-resource-store', function(Y, NAME) { if (res.name.indexOf('partials/') === 0) { // removing the "partials/" prefix details.partials[this._libs.path.basename(res.name)] = template; - } else { - details.views[res.name] = template; - details.views[res.name].assets = res.view.assets; - details.views[res.name].engine = res.view.engine; } + details.views[res.name] = template; + details.views[res.name].assets = res.view.assets; + details.views[res.name].engine = res.view.engine; + continue; } diff --git a/tests/func/applications/frameworkapp/common/mojits/ACMojit/controller.common.js b/tests/func/applications/frameworkapp/common/mojits/ACMojit/controller.common.js index 339d40faa..98f302138 100644 --- a/tests/func/applications/frameworkapp/common/mojits/ACMojit/controller.common.js +++ b/tests/func/applications/frameworkapp/common/mojits/ACMojit/controller.common.js @@ -61,9 +61,9 @@ YUI.add('ActionContextMojit', function(Y, NAME) { }else if(test=="done8"){ ac.done({data:"Hello, world!--from done"}, {view: {name: "mytemplate"}}); }else if(test=="done9"){ - ac.done({ foo: null }, {view: {name: "mytemplate1"}}); + ac.done({ foo: null }, {view: {name: "testdir/mytemplate1"}}); }else if(test=="done10"){ - ac.done({ foo: [ 1, 2, null, 4 ]}, {view: {name: "mytemplate1"}} ); + ac.done({ foo: [ 1, 2, null, 4 ]}, {view: {name: "testdir/mytemplate1"}} ); }else if(test=="flush8"){ ac.flush({data:"Hello, world!--from flush"}, {view: {name: "mytemplate"}}); ac.done(); diff --git a/tests/func/applications/frameworkapp/common/mojits/ACMojit/views/mytemplate1.mu.html b/tests/func/applications/frameworkapp/common/mojits/ACMojit/views/testdir/mytemplate1.mu.html similarity index 100% rename from tests/func/applications/frameworkapp/common/mojits/ACMojit/views/mytemplate1.mu.html rename to tests/func/applications/frameworkapp/common/mojits/ACMojit/views/testdir/mytemplate1.mu.html diff --git a/tests/func/applications/frameworkapp/common/mojits/PartialMojit/controller.common.js b/tests/func/applications/frameworkapp/common/mojits/PartialMojit/controller.common.js index 90a5acf1d..8d8909ae2 100644 --- a/tests/func/applications/frameworkapp/common/mojits/PartialMojit/controller.common.js +++ b/tests/func/applications/frameworkapp/common/mojits/PartialMojit/controller.common.js @@ -43,7 +43,7 @@ YUI.add('PartialMojit', function(Y, NAME) { ac.done(mymarkup); });*/ //ac.done(data); - ac.partial.render(data, "sub", function(error, mymarkup){ + ac.partial.render(data, "partials/sub", function(error, mymarkup){ Y.log("HereController....."+mymarkup); ac.done(mymarkup); }) diff --git a/tests/func/applications/frameworkapp/common/mojits/PartialMojit/views/partials/sub.mu.html b/tests/func/applications/frameworkapp/common/mojits/PartialMojit/views/partials/sub.mu.html new file mode 100644 index 000000000..6002d96a9 --- /dev/null +++ b/tests/func/applications/frameworkapp/common/mojits/PartialMojit/views/partials/sub.mu.html @@ -0,0 +1,3 @@ +
+ +
diff --git a/tests/func/applications/frameworkapp/common/mojits/PartialMojit/views/sub.mu.html b/tests/func/applications/frameworkapp/common/mojits/PartialMojit/views/sub.mu.html deleted file mode 100644 index 35a13dde5..000000000 --- a/tests/func/applications/frameworkapp/common/mojits/PartialMojit/views/sub.mu.html +++ /dev/null @@ -1,3 +0,0 @@ -
- -
\ No newline at end of file diff --git a/tests/unit/lib/app/addons/ac/test-partial.common.js b/tests/unit/lib/app/addons/ac/test-partial.common.js index 3b606fb8b..001b99f76 100644 --- a/tests/unit/lib/app/addons/ac/test-partial.common.js +++ b/tests/unit/lib/app/addons/ac/test-partial.common.js @@ -70,7 +70,7 @@ YUI().use('mojito-partial-addon', 'test', function (Y) { var mockRenderer = Mock(); Mock.expect(mockRenderer, { method: 'render', - args: [data, 'myInstanceType', Mock.Value.Object, Mock.Value.Object, Mock.Value.Object], + args: [data, command.instance, Mock.Value.Object, Mock.Value.Object, Mock.Value.Object], run: function (data, type, mojitView, adapter) { Assert.areEqual('myContentPath', mojitView['content-path']); adapter.done('renderdone'); diff --git a/tests/unit/lib/app/autoload/test-store.server.js b/tests/unit/lib/app/autoload/test-store.server.js index 26d9414fe..9727f8a00 100644 --- a/tests/unit/lib/app/autoload/test-store.server.js +++ b/tests/unit/lib/app/autoload/test-store.server.js @@ -149,7 +149,7 @@ YUI().use( 'server mojit instance views and binders': function() { var instance = {type:'test_mojit_1'}; store.expandInstanceForEnv('client', instance, {}, function(err, instance) { - A.areSame(3, Y.Object.keys(instance.views).length); + A.areSame(4, Y.Object.keys(instance.views).length); A.isObject(instance.views['test_1']); A.areSame('/static/test_mojit_1/views/test_1.hb.html', instance.views['test_1']['content-path']);