Added ability to load the same pad twice with helper.newPad, use this in load-message-tests

This commit is contained in:
mluto 2013-01-15 22:17:40 +01:00
parent 5eb09f981b
commit 09fa1d49a1
2 changed files with 16 additions and 15 deletions

View file

@ -56,13 +56,13 @@ var helper = {};
window.document.cookie = "";
}
helper.newPad = function(){
helper.newPad = function(cb, padName){
//build opts object
var opts = {clearCookies: true}
if(typeof arguments[0] === 'function'){
opts.cb = arguments[0]
if(typeof cb === 'function'){
opts.cb = cb
} else {
opts = _.defaults(arguments[0], opts);
opts = _.defaults(cb, opts);
}
//clear cookies
@ -70,7 +70,8 @@ var helper = {};
helper.clearCookies();
}
var padName = "FRONTEND_TEST_" + helper.randomString(20);
if(!padName)
padName = "FRONTEND_TEST_" + helper.randomString(20);
$iframe = $("<iframe src='/p/" + padName + "'></iframe>");
//clean up inner iframe references