Skip to content

Commit

Permalink
added format method tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Apr 10, 2011
1 parent 49a8f0a commit 36210e7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/resource.content-negotiation.test.js
Expand Up @@ -40,6 +40,22 @@ module.exports = {
{ url: '/pets/0.xml' },
{ body: '<pet>tobi</pet>' });
},

'test content-negotiation via format method': function(){
var app = express.createServer();

app.resource('pets', require('./fixtures/pets.format-methods'));

assert.response(app,
{ url: '/pets.xml' },
{ body: '<pets><pet>tobi</pet><pet>jane</pet><pet>loki</pet></pets>'
, headers: { 'Content-Type': 'application/xml' }});

assert.response(app,
{ url: '/pets.json' },
{ body: '["tobi","jane","loki"]'
, headers: { 'Content-Type': 'application/json' }});
},

'test nested content-negotiation': function(){
var app = express.createServer()
Expand Down

0 comments on commit 36210e7

Please sign in to comment.