Merge commit 'v7.10.23' into WebGUI8. Tests need fixing.
This commit is contained in:
commit
a2a821822d
72 changed files with 578 additions and 132 deletions
|
|
@ -20,6 +20,12 @@ use WebGUI::Session;
|
|||
use Test::Deep;
|
||||
use Scope::Guard;
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Tests
|
||||
|
||||
#plan tests => 9; # Increment this number for each test you create
|
||||
plan skip_all => 'Test server for LDAP down'; # Increment this number for each test you create
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Init
|
||||
my $session = WebGUI::Test->session;
|
||||
|
|
@ -41,11 +47,6 @@ $ldapGroup->set( "ldapGroupProperty", "member" );
|
|||
$ldapGroup->set( "ldapRecursiveProperty", "uid" );
|
||||
WebGUI::Test->addToCleanup($ldapGroup);
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Tests
|
||||
|
||||
plan tests => 9; # Increment this number for each test you create
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Test Login of existing user
|
||||
my $user = WebGUI::User->create( $session );
|
||||
|
|
|
|||
|
|
@ -53,6 +53,10 @@ my ($redirect, $response, $url);
|
|||
# Get the site's base URL
|
||||
my $baseUrl = 'http://localhost/';
|
||||
|
||||
my $httpAuthUrl = 'http://' . $USERNAME . ':' . $IDENTIFIER . '@' . $session->config->get('sitename')->[0];
|
||||
# $httpAuthUrl .= ':8000'; # no easy way to automatically find this
|
||||
$httpAuthUrl .= $session->config->get('gateway');
|
||||
|
||||
# Make an asset we can login on
|
||||
my $tag = WebGUI::VersionTag->getWorking($session);
|
||||
my $node = WebGUI::Test->asset;
|
||||
|
|
@ -74,7 +78,6 @@ my $asset = $asset->cloneFromDb;
|
|||
# Tests
|
||||
|
||||
my $mech = WebGUI::Test::Mechanize->new( config => WebGUI::Test->config );
|
||||
plan tests => 40; # Increment this number for each test you create
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# no form: Test logging in on a normal page sends the user back to the same page
|
||||
|
|
@ -263,3 +266,12 @@ $mech->submit_form_ok(
|
|||
);
|
||||
$mech->base_is( $assetUrl, "We don't get redirected" );
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# HTTP basic auth
|
||||
$mech = Test::WWW::Mechanize->new;
|
||||
$mech->get( $httpAuthUrl );
|
||||
$mech->content_contains( "Hello, $USERNAME", "We are greeted by name" );
|
||||
$mech->get( $httpAuthUrl . $asset->get('url') );
|
||||
$mech->content_contains( "ARTICLE", "We are shown the article" );
|
||||
|
||||
done_testing;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue