public
Created

  • Download Gist
routes-test.coffee
CoffeeScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
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)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.