lazorse = require '../'
client = require './client'
assert = require 'assert'

describe "An app with a single named resource", ->
  server = lazorse.server port: 0, host: '127.0.0.1', ->
    @resource "/I/have/{two}/{params}":
      shortName: 'theResource'
      GET: -> @ok {two: @two, params: @params}

    @examplePath = false
    @parameterPath = false

  it "has the right template", (done) ->
    client.usePort server.address().port
    client.GET '/', (res, index) ->
      console.log index
      assert.deepEqual index, [
        {shortName: 'theResource', methods: ['GET'], template: '/I/have/{two}/{params}'}
      ]
      done()
