                 target_sha1: argument.sha1
               json.argument.should.eql argument
               done()
+
+    describe 'GET /:name/:repo.:format?callback=:cbName', ->
+      it 'should show a repo as jsonp with custom callback', (done) ->
+        sessionWithArgument (user, argument, get, post) ->
+          get "/#{user.username}/#{argument.repo}.jsonp?callback=myCb", (err, res) ->
+            res.status.should.equal 200
+            res.redirects.should.eql []
+            res.type.should.equal 'text/javascript'
+            jsonp = res.text
+            myCb = (json) ->
+              should.not.exist json.error
+              json.user.should.include {username: user.username}
+              json.repo.should.eql argument.repo
+              json.commit.should.include
+                target_type: 'argument'
+                target_sha1: argument.sha1
+              json.argument.should.eql argument
+              done()
             eval jsonp

          get "/#{user.username}/#{argument.repo}.jsonp", (err, res) ->
            res.status.should.equal 200
            res.redirects.should.eql []
            res.type.should.equal 'text/javascript'
            jsonp = res.text
            jsonpCallback = (json) ->
              should.not.exist json.error
              json.user.should.include {username: user.username}
              json.repo.should.eql argument.repo

      res.status.should.equal 200
      callback user, data, get, post

# Verify JSONP Helper - Given a JSONP response, invokes callback with json.
verifyJSONP = (res, callback) ->
  res.type.should.equal 'text/javascript'
  res.text.should.exist
  jsonp = res.text
  jsonpCallback = (json) ->
    callback(json)
  eval jsonp

# Superagent helpers.
agent = superagent.agent()
get = getFor agent
