Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
persona
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hexang 息壤平台
persona
Commits
581a6864
Commit
581a6864
authored
13 years ago
by
Lloyd Hilaiel
Browse files
Options
Downloads
Patches
Plain Diff
final tests for forgotten password desired behavior
parent
efd15aa3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
browserid/tests/forgotten-email-test.js
+54
-8
54 additions, 8 deletions
browserid/tests/forgotten-email-test.js
with
54 additions
and
8 deletions
browserid/tests/forgotten-email-test.js
+
54
−
8
View file @
581a6864
...
...
@@ -235,16 +235,62 @@ suite.addBatch({
});
// verify that the old email address + password combinations are still
// valid (*until* someone clicks through)
// try to log into the first email address with oldpassword
// XXX
// valid (this is so *until* someone clicks through)
suite
.
addBatch
({
"
first email works
"
:
{
topic
:
wsapi
.
get
(
'
/wsapi/authenticate_user
'
,
{
email
:
'
first@fakeemail.com
'
,
pass
:
'
firstfakepass
'
}),
"
should work
"
:
function
(
r
,
err
)
{
assert
.
strictEqual
(
true
,
JSON
.
parse
(
r
.
body
));
}
},
"
second email works
"
:
{
topic
:
wsapi
.
get
(
'
/wsapi/authenticate_user
'
,
{
email
:
'
second@fakeemail.com
'
,
pass
:
'
firstfakepass
'
}),
"
should work
"
:
function
(
r
,
err
)
{
assert
.
strictEqual
(
true
,
JSON
.
parse
(
r
.
body
));
}
}
});
// try to log into the second email address with oldpassword
// XXX
// now let's complete the re-registration of first email address
suite
.
addBatch
({
"
re-create first email address
"
:
{
topic
:
function
()
{
wsapi
.
get
(
'
/wsapi/prove_email_ownership
'
,
{
token
:
token
}).
call
(
this
);
},
"
account created
"
:
function
(
r
,
err
)
{
assert
.
equal
(
r
.
code
,
200
);
}
}
});
// try to log into the first email with newpassword
// XXX
// now we should be able to log into the first email address with the second
// password, and all other combinations should fail
suite
.
addBatch
({
"
first email, first pass bad
"
:
{
topic
:
wsapi
.
get
(
'
/wsapi/authenticate_user
'
,
{
email
:
'
first@fakeemail.com
'
,
pass
:
'
firstfakepass
'
}),
"
shouldn't work
"
:
function
(
r
,
err
)
{
assert
.
strictEqual
(
JSON
.
parse
(
r
.
body
),
false
);
}
},
"
first email, second pass good
"
:
{
topic
:
wsapi
.
get
(
'
/wsapi/authenticate_user
'
,
{
email
:
'
first@fakeemail.com
'
,
pass
:
'
secondfakepass
'
}),
"
should work
"
:
function
(
r
,
err
)
{
assert
.
strictEqual
(
JSON
.
parse
(
r
.
body
),
true
);
}
},
"
second email, first pass bad
"
:
{
topic
:
wsapi
.
get
(
'
/wsapi/authenticate_user
'
,
{
email
:
'
second@fakeemail.com
'
,
pass
:
'
firstfakepass
'
}),
"
shouldn't work
"
:
function
(
r
,
err
)
{
assert
.
strictEqual
(
JSON
.
parse
(
r
.
body
),
false
);
}
},
"
second email, second pass bad
"
:
{
topic
:
wsapi
.
get
(
'
/wsapi/authenticate_user
'
,
{
email
:
'
second@fakeemail.com
'
,
pass
:
'
secondfakepass
'
}),
"
shouldn' work
"
:
function
(
r
,
err
)
{
assert
.
strictEqual
(
JSON
.
parse
(
r
.
body
),
false
);
}
},
});
// stop the server
suite
.
addBatch
({
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment