/[A3C]/t/00-action-SyncOrganization.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /t/00-action-SyncOrganization.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 106 - (hide annotations)
Thu May 1 17:06:02 2008 UTC (14 years, 3 months ago) by dpavlin
File MIME type: application/x-troff
File size: 902 byte(s)
massive re-structuring to enable models specified in configuration file

- version bump [0.04]
- SyncOrganization now accept org_uid as argument
- objectClass(es) for person and organization are now in config.yml
  as well as link between them (filter on person)
- config.yml is now checked for validity in A3C::LDAP
1 dpavlin 55 #!/usr/bin/env perl
2     use warnings;
3     use strict;
4    
5     =head1 DESCRIPTION
6    
7     A (very) basic test harness for the SyncOrganization action.
8    
9     =cut
10    
11 dpavlin 106 use Jifty::Test tests => 9;
12 dpavlin 55
13     # Make sure we can load the action
14     use_ok('A3C::Action::SyncOrganization');
15 dpavlin 106 use_ok('A3C::LDAP');
16 dpavlin 55
17 dpavlin 106 ok(my $person_oc = A3C::LDAP->new->objectClass->{person}, 'LDAP.objectClass.person exist');
18    
19 dpavlin 55 my $sync = Jifty::Test->web->new_action(
20     class => 'SyncOrganization',
21     # current_user => $system_user,
22     arguments => {}
23     );
24    
25     isa_ok( $sync, 'A3C::Action::SyncOrganization' );
26    
27 dpavlin 106 ok( $sync->arguments->{org_uid}, 'org_uid' );
28 dpavlin 55
29 dpavlin 106 $sync->argument_values({ org_uid => 'os-test0604-zg' });
30 dpavlin 55 $sync->run;
31    
32     ok( $sync->result->success, 'result is success' );
33    
34     ok( my $coll = $sync->result->content( 'synced-users' ), 'result content have synced-users' );
35    
36 dpavlin 106 isa_ok( $coll, "A3C::Model::${person_oc}Collection" );
37 dpavlin 55
38     cmp_ok( $coll->count, '>', 0, 'count' );

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26