-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add username and register/login prompts (#34)
* add username and register/login prompts * email address -> email
- Loading branch information
Showing
4 changed files
with
72 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,34 +27,8 @@ authServer(port, function (server) { | |
st.end() | ||
}) | ||
|
||
test('auth - register requires email', function (t) { | ||
var cmd = dat + ' register ' | ||
var st = spawn(t, cmd, {cwd: baseTestDir}) | ||
st.stderr.match(function (output) { | ||
t.ok(output.indexOf('Email is required') > -1, 'outputs correct error message') | ||
st.kill() | ||
return true | ||
}) | ||
st.stdout.empty() | ||
st.fails() | ||
st.end() | ||
}) | ||
|
||
test('auth - register requires email and password', function (t) { | ||
var cmd = dat + ' register [email protected]' | ||
var st = spawn(t, cmd, {cwd: baseTestDir}) | ||
st.stderr.match(function (output) { | ||
t.ok(output.indexOf('Password is required') > -1, 'outputs correct error message') | ||
st.kill() | ||
return true | ||
}) | ||
st.stdout.empty() | ||
st.fails() | ||
st.end() | ||
}) | ||
|
||
test('auth - register works', function (t) { | ||
var cmd = dat + ' register [email protected] --password=joe' | ||
var cmd = dat + ' register [email protected] --password=joe --username=joe' | ||
var st = spawn(t, cmd, {cwd: baseTestDir}) | ||
st.stdout.match(function (output) { | ||
t.same(output.trim(), 'Registered successfully.', 'output success message') | ||
|
@@ -64,30 +38,6 @@ authServer(port, function (server) { | |
st.end() | ||
}) | ||
|
||
test('auth - login requires email', function (t) { | ||
var cmd = dat + ' login --password=joe' | ||
var st = spawn(t, cmd, {cwd: baseTestDir}) | ||
st.stderr.match(function (output) { | ||
t.ok(output.indexOf('Email is required') > -1, 'outputs correct error message') | ||
st.kill() | ||
return true | ||
}) | ||
st.stdout.empty() | ||
st.end() | ||
}) | ||
|
||
test('auth - login requires email and password', function (t) { | ||
var cmd = dat + ' login [email protected]' | ||
var st = spawn(t, cmd, {cwd: baseTestDir}) | ||
st.stderr.match(function (output) { | ||
t.ok(output.indexOf('Password is required') > -1, 'outputs correct error message') | ||
st.kill() | ||
return true | ||
}) | ||
st.stdout.empty() | ||
st.end() | ||
}) | ||
|
||
test('auth - login works', function (t) { | ||
var cmd = dat + ' login [email protected] --password=joe' | ||
var st = spawn(t, cmd, {cwd: baseTestDir}) | ||
|