 		expect(err).to.be.oneOf [null, undefined]
 		expect(response.statusCode).to.equal 302
 		expect(response.headers.location).to.equal "/project/#{invite.projectId}"
+		callback()
+
+expectInviteListCount = (user, projectId, count, callback=(err)->) ->
+	tryGetInviteList user, projectId, (err, response, body) ->
+		expect(err).to.be.oneOf [null, undefined]
+		expect(response.statusCode).to.equal 200
+		expect(body).to.have.all.keys ['invites']
+		expect(body.invites.length).to.equal count
 		callback()
 
 

			(cb) => @user.logout cb
			(cb) => @sendingUser.login cb
		], done

	describe 'clicking the invite link', ->


				redir: redir
		}, callback

tryGetInviteList = (user, projectId, callback=(err, response, body)->) ->
	user.getCsrfToken (error) =>
		return callback(error) if error?
		user.request.get {
			url: "/project/#{projectId}/invites"
			json: true
		}, callback


# Expectations
expectProjectAccess = (user, projectId, callback=(err,result)->) ->
