Skip to content

Instantly share code, notes, and snippets.

@asalant
Created October 11, 2012 04:47
Show Gist options
  • Select an option

  • Save asalant/3870227 to your computer and use it in GitHub Desktop.

Select an option

Save asalant/3870227 to your computer and use it in GitHub Desktop.
Ubiquitous JS example: Orders Controller spec
{Factory} = require '../../../support/spec_helper'
request = require 'request'
$ = require 'jquery'
describe 'Orders Controller', ->
describe 'when there is an order for pickup', ->
beforeEach ->
Factory.create 'orderForPickup'
it "renders list of orders", (done) ->
request "/orders", (err, response) ->
expect(response.statusCode).toEqual 200
expect($('.orders li', response.body).length).toEqual 1
done(err)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment