Skip to content

Commit

Permalink
Default layout overriding test.
Browse files Browse the repository at this point in the history
  • Loading branch information
bredikhin committed Mar 17, 2014
1 parent c240fae commit 962da6d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
3 changes: 3 additions & 0 deletions test/fixtures/views/another-layout.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<body>
From another layout: <%- body %>
</body>
20 changes: 18 additions & 2 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,25 @@ describe('View renderer', function() {
});
});

it('should render views with default layout overriden');
it('should render views with default layout overriden', function(done) {
var renderer = views(
path.join(process.cwd(), 'test', 'fixtures', 'views'),
{ default: 'ejs', defaultLayout: 'layout' }
);

it('should work with layout specified without local variables');
var template = renderer('view', { msg: 'Hello, World!' }, 'another-layout');

template(function(err, html) {
if (err)
return done(err);

html.should.containEql('Hello, World!');
html.should.not.containEql('From the default layout: ');
html.should.containEql('From another layout: ');

done();
});
});

it('should work with layout specified without local variables');
});
Expand Down

0 comments on commit 962da6d

Please sign in to comment.