[Jifty-commit] r4333 - in jifty/branches/prototype-1.6:
lib/Jifty/Test/WWW share/web/static/js t/TestApp-Plugin-OnClick/t
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Tue Oct 30 07:57:20 EDT 2007
Author: sunnavy
Date: Tue Oct 30 07:57:19 2007
New Revision: 4333
Modified:
jifty/branches/prototype-1.6/lib/Jifty/Test/WWW/Selenium.pm
jifty/branches/prototype-1.6/share/web/static/js/jifty.js
jifty/branches/prototype-1.6/t/TestApp-Plugin-OnClick/share/web/templates/content.html
jifty/branches/prototype-1.6/t/TestApp-Plugin-OnClick/share/web/templates/onclick.html
jifty/branches/prototype-1.6/t/TestApp-Plugin-OnClick/t/onclick.t
Log:
reserve bare update for a moment, alert people to switch to Jifty.update, and tests for that. also added /usr/lib/mozilla-firefox(default firefox path on Gentoo) to $ENV{PATH} for Selenium.
Modified: jifty/branches/prototype-1.6/lib/Jifty/Test/WWW/Selenium.pm
==============================================================================
--- jifty/branches/prototype-1.6/lib/Jifty/Test/WWW/Selenium.pm (original)
+++ jifty/branches/prototype-1.6/lib/Jifty/Test/WWW/Selenium.pm Tue Oct 30 07:57:19 2007
@@ -111,7 +111,7 @@
close *STDOUT;
}
$ENV{LANG} = $args{lang} || 'en_US.UTF-8';
- $ENV{PATH} = "$ENV{PATH}:/usr/lib/firefox";
+ $ENV{PATH} = "$ENV{PATH}:/usr/lib/firefox:/usr/lib/mozilla-firefox";
Test::More::diag "start selenium rc [$$]";
local $SIG{CHLD} = \&_REAPER;
local $SIG{TERM} = sub { exit 0 };
Modified: jifty/branches/prototype-1.6/share/web/static/js/jifty.js
==============================================================================
--- jifty/branches/prototype-1.6/share/web/static/js/jifty.js (original)
+++ jifty/branches/prototype-1.6/share/web/static/js/jifty.js Tue Oct 30 07:57:19 2007
@@ -1271,6 +1271,11 @@
return false;
}
+function update ( named_args, trigger ) {
+ alert( 'please use Jifty.update instead of update.' );
+ return Jifty.update( named_args, trigger );
+}
+
function trace( msg ){
if( typeof( jsTrace ) != 'undefined' ){
jsTrace.send( msg );
Modified: jifty/branches/prototype-1.6/t/TestApp-Plugin-OnClick/share/web/templates/content.html
==============================================================================
--- jifty/branches/prototype-1.6/t/TestApp-Plugin-OnClick/share/web/templates/content.html (original)
+++ jifty/branches/prototype-1.6/t/TestApp-Plugin-OnClick/share/web/templates/content.html Tue Oct 30 07:57:19 2007
@@ -1 +1 @@
-content
+original content
Modified: jifty/branches/prototype-1.6/t/TestApp-Plugin-OnClick/share/web/templates/onclick.html
==============================================================================
--- jifty/branches/prototype-1.6/t/TestApp-Plugin-OnClick/share/web/templates/onclick.html (original)
+++ jifty/branches/prototype-1.6/t/TestApp-Plugin-OnClick/share/web/templates/onclick.html Tue Oct 30 07:57:19 2007
@@ -3,7 +3,7 @@
args:<% Jifty->web->request->arguments->{'J:V-region-content'} || ''%>
<% Jifty->web->link(
- label => 'content',
+ label => 'replace content',
id => 'replace_content',
onclick => {
replace_with => '/content1.html',
@@ -17,4 +17,10 @@
) %>
+<a id="original_content"
+href="/onclick.html?J:V-region-content=%2Fcontent.html"
+onclick="return update(
+{'continuation':{},'actions':{},'fragments':[{'mode':'Replace','args':{},'region':'content','path':'/content.html'}],'action_arguments':{}},
+this );">revert content</a>
+
</&>
Modified: jifty/branches/prototype-1.6/t/TestApp-Plugin-OnClick/t/onclick.t
==============================================================================
--- jifty/branches/prototype-1.6/t/TestApp-Plugin-OnClick/t/onclick.t (original)
+++ jifty/branches/prototype-1.6/t/TestApp-Plugin-OnClick/t/onclick.t Tue Oct 30 07:57:19 2007
@@ -2,13 +2,13 @@
use warnings;
use lib 't/lib';
use Jifty::SubTest;
-use Jifty::Test tests => 6;
+use Jifty::Test tests => 10;
use Jifty::Test::WWW::Selenium;
use utf8;
-my $server = Jifty::Test->make_server;
-my $sel = Jifty::Test::WWW::Selenium->rc_ok( $server );
-my $URL = $server->started_ok;
+my $server = Jifty::Test->make_server;
+my $sel = Jifty::Test::WWW::Selenium->rc_ok($server);
+my $URL = $server->started_ok;
$sel->open_ok("/onclick.html");
$sel->click_ok("//a[\@id='replace_content']");
@@ -18,5 +18,14 @@
like( $html, qr/yatta/, 'replace content correctly' );
unlike( $html, qr{args:/content1\.html}, 'replaced by javascript' );
+$sel->click_ok("//a[\@id='original_content']");
+is( $sel->get_alert,
+ 'please use Jifty.update instead of update.',
+ 'bare update is deprecated'
+);
+$html = $sel->get_html_source;
+like( $html, qr/original content/, 'replace content correctly' );
+unlike( $html, qr{args:/content\.html}, 'replaced by javascript' );
+
$sel->stop;
More information about the Jifty-commit
mailing list