 					Async.series [
 						(cb) => expectInviteRedirectToRegister(@user, @link, cb)
 					], done
+
+				it 'should allow user to accept the invite if the user registers a new account', (done) ->
+					Async.series [
+						(cb) =>
+							expectInviteRedirectToRegister @user, @link, (err, redirectUrl) =>
+								@_redir = redirectUrl
+								cb()
+						(cb) =>
+							expectRegistrationRedirectToInvite @user, "some_email@example.com", @_redir, @link, cb
+						(cb) =>
+							expectInvitePage @user, @link, cb
+						(cb) =>
+							expectAcceptInviteAndRedirect @user, @invite, cb
+					], done

		expect(body).to.match new RegExp("<title>Invalid Invite - .*</title>")
		callback()

expectInviteRedirectToRegister = (user, link, callback=()->) ->
	# view invite, redirect to `/register`
	tryFollowInviteLink user, link, (err, response, body) ->
		expect(err).to.be.oneOf [null, undefined]
		expect(response.statusCode).to.equal 302
		expect(response.headers.location).to.match new RegExp("^/register\?.*redir=.*$")
		callback()

expectInviteRedirectToProject = (user, link, invite, callback=()->) ->
	# view invite, redirect straight to project
	tryFollowInviteLink user, link, (err, response, body) ->
		expect(err).to.be.oneOf [null, undefined]

		expect(response.headers.location).to.equal "/project/#{invite.projectId}"
		callback()

expectAcceptInviteAndRedirect = (user, invite, callback=(err,result)->) ->
	# should accept the invite and redirect to project
	tryAcceptInvite user, invite, (err, response, body) =>
		expect(err).to.be.oneOf [null, undefined]
