From 0b90e5752be46113b3fcc9ae71a71c68c8a335f3 Mon Sep 17 00:00:00 2001 From: mluto Date: Mon, 28 Jan 2013 21:38:56 +0100 Subject: [PATCH] Added a test to check the export-url --- tests/frontend/specs/timeslider_revisions.js | 27 ++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/frontend/specs/timeslider_revisions.js b/tests/frontend/specs/timeslider_revisions.js index de8ca52f..52f48764 100644 --- a/tests/frontend/specs/timeslider_revisions.js +++ b/tests/frontend/specs/timeslider_revisions.js @@ -121,4 +121,31 @@ describe("timeslider", function(){ }); }, 2500); }); + + it("checks the export url", function(done) { + var inner$ = helper.padInner$; + var chrome$ = helper.padChrome$; + this.timeout(11000); + inner$("div").first().sendkeys('a'); + + setTimeout(function() { + // go to timeslider + $('#iframe-container iframe').attr('src', $('#iframe-container iframe').attr('src')+'/timeslider#0'); + var timeslider$; + var exportLink; + + helper.waitFor(function(){ + timeslider$ = $('#iframe-container iframe')[0].contentWindow.$; + if(!timeslider$) + return false; + exportLink = timeslider$('#exportplaina').attr('href'); + if(!exportLink) + return false; + return exportLink.substr(exportLink.length - 12) == "0/export/txt"; + }, 6000).always(function(){ + expect( exportLink.substr(exportLink.length - 12) ).to.eql( "0/export/txt" ); + done(); + }); + }, 2500); + }); });