Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
46469443
Commit
46469443
authored
Mar 31, 2015
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some auth tests.
parent
14c09c50
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
2 deletions
+46
-2
spec/converse.js
spec/converse.js
+46
-2
No files found.
spec/converse.js
View file @
46469443
...
...
@@ -11,13 +11,57 @@
var
b64_sha1
=
converse_api
.
env
.
b64_sha1
;
return
describe
(
"
Converse
"
,
$
.
proxy
(
function
(
mock
,
test_utils
)
{
describe
(
"
Authentication
"
,
function
()
{
it
(
"
needs either a bosh_service_url a websocket_url or both
"
,
function
()
{
expect
(
converse
.
initConnection
.
bind
({})).
toThrow
(
new
Error
(
"
initConnection: you must supply a value for either the bosh_service_url or websocket_url or both.
"
));
});
describe
(
"
with prebind
"
,
function
()
{
it
(
"
needs a jid when also using keepalive
"
,
function
()
{
var
connection
=
converse
.
connection
;
var
jid
=
converse
.
jid
;
converse
.
bosh_service_url
=
"
localhost
"
;
converse
.
connection
=
undefined
;
converse
.
jid
=
undefined
;
converse
.
keepalive
=
true
;
converse
.
prebind
=
true
;
expect
(
converse
.
initConnection
.
bind
(
converse
)).
toThrow
(
new
Error
(
"
initConnection: when using 'keepalive' with 'prebind, you must supply the JID of the current user.
"
));
converse
.
bosh_service_url
=
undefined
;
converse
.
connection
=
connection
;
converse
.
jid
=
jid
;
converse
.
keepalive
=
undefined
;
converse
.
prebind
=
undefined
;
});
it
(
"
needs jid, rid and sid values when not using keepalive
"
,
function
()
{
var
connection
=
converse
.
connection
;
var
jid
=
converse
.
jid
;
converse
.
bosh_service_url
=
"
localhost
"
;
converse
.
connection
=
undefined
;
converse
.
jid
=
undefined
;
converse
.
keepalive
=
false
;
converse
.
prebind
=
true
;
expect
(
converse
.
initConnection
.
bind
(
converse
)).
toThrow
(
new
Error
(
"
initConnection: If you use prebind and not keepalive, then you MUST supply JID, RID and SID values
"
));
converse
.
bosh_service_url
=
undefined
;
converse
.
connection
=
connection
;
converse
.
jid
=
jid
;
converse
.
keepalive
=
undefined
;
converse
.
prebind
=
undefined
;
});
});
});
describe
(
"
The
\"
tokens
\"
API
"
,
$
.
proxy
(
function
()
{
beforeEach
(
$
.
proxy
(
function
()
{
beforeEach
(
function
()
{
test_utils
.
closeAllChatBoxes
();
test_utils
.
clearBrowserStorage
();
converse
.
rosterview
.
model
.
reset
();
test_utils
.
createContacts
(
'
current
'
);
}
,
converse
)
);
});
it
(
"
has a method for retrieving the next RID
"
,
$
.
proxy
(
function
()
{
var
old_connection
=
converse
.
connection
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment