summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/npm-registry-client/test/adduser-update.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/npm-registry-client/test/adduser-update.js')
-rw-r--r--deps/npm/node_modules/npm-registry-client/test/adduser-update.js23
1 files changed, 17 insertions, 6 deletions
diff --git a/deps/npm/node_modules/npm-registry-client/test/adduser-update.js b/deps/npm/node_modules/npm-registry-client/test/adduser-update.js
index 2c5ccde6e..6732f7ba0 100644
--- a/deps/npm/node_modules/npm-registry-client/test/adduser-update.js
+++ b/deps/npm/node_modules/npm-registry-client/test/adduser-update.js
@@ -19,6 +19,13 @@ var password = "%1234@asdf%"
tap.test("update a user acct", function (t) {
+ var auth = {
+ username : username,
+ password : password,
+ email : email
+ }
+ var params = { auth : auth }
+
server.expect("PUT", "/-/user/org.couchdb.user:username", function (req, res) {
t.equal(req.method, "PUT")
res.statusCode = 409
@@ -45,13 +52,17 @@ tap.test("update a user acct", function (t) {
t.deepEqual(o, userdata)
res.statusCode = 201
- res.json({created:true})
+ res.json(auth)
})
})
- client.adduser("http://localhost:1337/", username, password, email, function (er, data) {
- if (er) throw er
- t.deepEqual(data, { created: true })
- t.end()
- })
+ client.adduser(
+ "http://localhost:1337/",
+ params,
+ function (er, data) {
+ if (er) throw er
+ t.deepEqual(data, auth, "got expected auth data")
+ t.end()
+ }
+ )
})