Skip to content

Instantly share code, notes, and snippets.

@dangerbell
Created November 1, 2012 20:07
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 dangerbell/3996121 to your computer and use it in GitHub Desktop.
Save dangerbell/3996121 to your computer and use it in GitHub Desktop.
Example of using SuperTest in Mocha
request = require 'supertest'
app = require process.cwd() + '/app.coffee'
describe 'Connectors', ->
describe 'create', ->
it "should return a 400 error if there is no type specified", (done) ->
request(app)
.post("/connectors")
.set( 'Authorization', "MoverApi app_id=embiggen app_secret=cromulent" )
.send( {} )
.expect(400, {
status: "Missing Parameter",
msg: "Must specify a type to create a connector. See documentation at http://mover.io/docs" },
done
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment