[Jifty-commit] r4881 - in jifty/trunk: .
t/TestApp-Plugin-OAuth/lib/TestApp/Plugin/OAuth
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Fri Jan 18 07:06:54 EST 2008
Author: sartak
Date: Fri Jan 18 07:06:54 2008
New Revision: 4881
Modified:
jifty/trunk/ (props changed)
jifty/trunk/t/TestApp-Plugin-OAuth/lib/TestApp/Plugin/OAuth/View.pm
jifty/trunk/t/TestApp-Plugin-OAuth/t/05-protected-resource.t
Log:
r50534 at onn: sartak | 2008-01-18 07:06:11 -0500
A few more OAuth tests I had left uncommitted, tired of 's'ing them :)
Modified: jifty/trunk/t/TestApp-Plugin-OAuth/lib/TestApp/Plugin/OAuth/View.pm
==============================================================================
--- jifty/trunk/t/TestApp-Plugin-OAuth/lib/TestApp/Plugin/OAuth/View.pm (original)
+++ jifty/trunk/t/TestApp-Plugin-OAuth/lib/TestApp/Plugin/OAuth/View.pm Fri Jan 18 07:06:54 2008
@@ -6,6 +6,7 @@
template '/nuke/the/whales' => page {
h1 { "Press the shiny red button." }
+ h2 { "You are human #" . Jifty->web->current_user->id . "." }
};
1;
Modified: jifty/trunk/t/TestApp-Plugin-OAuth/t/05-protected-resource.t
==============================================================================
--- jifty/trunk/t/TestApp-Plugin-OAuth/t/05-protected-resource.t (original)
+++ jifty/trunk/t/TestApp-Plugin-OAuth/t/05-protected-resource.t Fri Jan 18 07:06:54 2008
@@ -5,7 +5,7 @@
use Test::More;
BEGIN {
if (eval { require Net::OAuth::Request; require Crypt::OpenSSL::RSA; 1 }) {
- plan tests => 27;
+ plan tests => 31;
}
else {
plan skip_all => "Net::OAuth isn't installed";
@@ -79,12 +79,14 @@
token_secret => $token_obj->secret,
);
$cmech->content_contains("Press the shiny red button", "got to a protected page");
+$cmech->content_contains("human #1.", "correct current_user");
# }}}
# without OAuth parameters, no access {{{
$cmech->get_ok('/nuke/the/whales');
$cmech->content_contains("Login with a password", "current_user unset");
$cmech->content_lacks("Press the shiny red button", "did NOT get to a protected page");
+$cmech->content_lacks("human #1.", "did NOT get to a protected page");
# }}}
# access tokens last for more than one hit {{{
response_is(
@@ -98,6 +100,7 @@
token_secret => $token_obj->secret,
);
$cmech->content_contains("Press the shiny red button", "got to a protected page");
+$cmech->content_contains("human #1.", "correct current_user");
# }}}
# expired access token {{{
$token_obj->set_valid_until(DateTime->now->subtract(days => 1));
@@ -114,4 +117,5 @@
);
$cmech->content_contains("Login with a password", "redirected to login");
$cmech->content_lacks("Press the shiny red button", "did NOT get to a protected page");
+$cmech->content_lacks("human #1.", "did NOT get to a protected page");
# }}}
More information about the Jifty-commit
mailing list