Skip to content

Instantly share code, notes, and snippets.

@jamescarr
Created January 16, 2012 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamescarr/1621503 to your computer and use it in GitHub Desktop.
Save jamescarr/1621503 to your computer and use it in GitHub Desktop.
routes = require "../routes/index"
require "should"
describe "routes", ->
req = {}
res = {}
describe "index", ->
it "should display index with posts", (done)->
res.render = (view, vars) ->
view.should.equal "index"
vars.title.should.equal "My Coffeepress Blog"
vars.posts.should.eql []
done()
routes.index(req, res)
describe "new post", ->
it "should display the add post page", (done) ->
res.render = (view, vars) ->
view.should.equal "add_post"
vars.title.should.equal "Write New Post"
done()
routes.newPost(req, res)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment