[Cpan-forum-commit] rev 184 - in trunk: . bin lib/CPAN t/mech templates www

svn at pti.co.il svn at pti.co.il
Tue Aug 29 15:14:58 IDT 2006


Author: gabor
Date: 2006-08-29 15:14:57 +0300 (Tue, 29 Aug 2006)
New Revision: 184

Modified:
   trunk/
   trunk/Build.PL
   trunk/Changes
   trunk/TODO
   trunk/bin/populate.pl
   trunk/lib/CPAN/Forum.pm
   trunk/t/mech/100-auth.t
   trunk/templates/mypan.tmpl
   trunk/www/robots.txt
Log:
add tests to /mypan




Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - 8c4c90e1-83eb-0310-96eb-e7cb62807872:/local/cpan-forum:11035
   + 8c4c90e1-83eb-0310-96eb-e7cb62807872:/local/cpan-forum:11036

Modified: trunk/Build.PL
===================================================================
--- trunk/Build.PL	2006-08-29 12:14:49 UTC (rev 183)
+++ trunk/Build.PL	2006-08-29 12:14:57 UTC (rev 184)
@@ -40,6 +40,7 @@
         'Class::DBI::Plugin::AbstractCount'     => 0,
         'Class::DBI::Plugin::Pager'             => 0,
         'Text::CSV_XS'                          => 0,
+        'List::MoreUtils'                       => 0,
     },
     build_requires => {
         'Test::More'                            => 0.47,

Modified: trunk/Changes
===================================================================
--- trunk/Changes	2006-08-29 12:14:49 UTC (rev 183)
+++ trunk/Changes	2006-08-29 12:14:57 UTC (rev 184)
@@ -1,6 +1,8 @@
 
 v0.12 
 
+  Cookie exparation was increased from 1 day to 14 days
+
   Provide a csv file with the number of posts for each distribution so 
   other sites can include it.
   Create stats page with top 50 modules

Modified: trunk/TODO
===================================================================
--- trunk/TODO	2006-08-29 12:14:49 UTC (rev 183)
+++ trunk/TODO	2006-08-29 12:14:57 UTC (rev 184)
@@ -8,7 +8,18 @@
 
   Improve the populate.pl, look at CPANTS for ideas:
   http://search.cpan.org/src/DOMM/Module-CPANTS-ProcessCPAN-0.62/bin/update_authors.pl
+  Finish the recent.pl file and maybe replace the populate.pl by using recent.pl
 
+  When a request arrives to /dist/XYZ and XYZ is not in our database
+  we can fetch http://search.cpan.org/dist/XYZ and add the entry to our 
+  database. In order not to let some random person bombard our server and that
+  in turn that we don't bombard search.cpan.org (though our server will 
+  crash much sooner than search.cpan.org) we can add a list of trusted client
+  ip addresses from the list in the log file. After all very soon most of the
+  correct entries will be added to the database. A trusted ip would be
+  GoogleBot 66.249.66.3, msnbot 65.55.213.74, inktomisearch and similar
+  
+  
 
   Cleanup the schema. Currently the schema/schema.sql is not the same as the
   schema used in the live application.

Modified: trunk/bin/populate.pl
===================================================================
--- trunk/bin/populate.pl	2006-08-29 12:14:49 UTC (rev 183)
+++ trunk/bin/populate.pl	2006-08-29 12:14:57 UTC (rev 184)
@@ -32,8 +32,9 @@
 
 print "This operation can take a couple of minutes\n";
 
+# use this file to retreive list of CPAN authors and their e-mail address 
+# http://www.cpan.org/authors/01mailrc.txt.gz
 
-
 if (not $opts{source}) {
     my $file = "02packages.details.txt";
     $opts{source} = "$opts{dir}/$file";

Modified: trunk/lib/CPAN/Forum.pm
===================================================================
--- trunk/lib/CPAN/Forum.pm	2006-08-29 12:14:49 UTC (rev 183)
+++ trunk/lib/CPAN/Forum.pm	2006-08-29 12:14:57 UTC (rev 184)
@@ -2347,6 +2347,14 @@
     }
 }
 
+sub process_missing_dist {
+    my ($self) = @_;
+    #http://search.cpan.org/dist/Net-Libnet/ 
+}
+
+
+
+
 1;
 
 =head1 ACKNOWLEDGEMENTS

Modified: trunk/t/mech/100-auth.t
===================================================================
--- trunk/t/mech/100-auth.t	2006-08-29 12:14:49 UTC (rev 183)
+++ trunk/t/mech/100-auth.t	2006-08-29 12:14:57 UTC (rev 184)
@@ -131,10 +131,80 @@
     BEGIN { $tests += 6; }
 }
 
+my @input_fields;
+BEGIN { @input_fields = (
+        ['allposts__all',    'checkbox',  'HTML::Form::ListInput',   undef],
+        ['starters__all',    'checkbox',  'HTML::Form::ListInput',   undef],
+        ['followups__all',   'checkbox',  'HTML::Form::ListInput',   undef],
+        ['allposts__new',    'checkbox',  'HTML::Form::ListInput',   undef],
+        ['starters__new',    'checkbox',  'HTML::Form::ListInput',   undef],
+        ['followups__new',   'checkbox',  'HTML::Form::ListInput',   undef],
+        ['type',             'option',    'HTML::Form::ListInput',   ''],
+        ['rm',               'hidden',    'HTML::Form::TextInput',   'update_subscription'],
+        ['gids',             'hidden',    'HTML::Form::TextInput',   '_all'],
+        ['submit',           'submit',    'HTML::Form::SubmitInput', 'Update'],
+        ['name',             'text',      'HTML::Form::TextInput',   ''],
+    );
+}
+
 {
     $w_user->follow_link_ok({ text => 'home' });
     $w_user->follow_link_ok({ text => 'mypan' });
+    $w_user->content_like(qr{Personal configuration of}); # fname lname (username)
+    my ($form) = $w_user->forms;
+    isa_ok($form, 'HTML::Form');
+    is($form->method, 'POST');
+    is($form->action, "$url/");
+    check_form($form, \@input_fields);
 
-    BEGIN { $tests += 2; }
+    BEGIN { $tests += 7 + @input_fields*2; }
 }
 
+{
+    # submit without any changes
+    $w_user->submit_form();
+    $w_user->content_like(qr{Your subscriptions were successfully updated.});
+    $w_user->content_like(qr{You can look at them here:});
+    $w_user->follow_link_ok({ text => 'subscription information' });
+    my ($form) = $w_user->forms;
+    check_form($form, \@input_fields);
+    
+    BEGIN { $tests += 4 + @input_fields*2 }
+}
+
+foreach my $i (0..2) {
+    my $input = $w_user->current_form->find_input( $input_fields[$i][0] );
+    $input->check;
+    $w_user->submit_form();
+    $w_user->content_like(qr{Your subscriptions were successfully updated.});
+    $w_user->content_like(qr{You can look at them here:});
+    $w_user->follow_link_ok({ text => 'subscription information' });
+    my ($form) = $w_user->forms;
+    $input_fields[$i][3] = 'on';
+    check_form($form, \@input_fields);
+    # TODO: check it in the database as well....    
+
+    BEGIN { $tests += 3*(4 + @input_fields*2) }
+}
+
+
+
+sub check_form {
+    my ($form, $input_fields_ref) = @_;
+    foreach my $i (@$input_fields_ref) {
+        my ($name, $type, $obj, $value) = @$i;
+        my $input = $form->find_input( $name, $type);
+        isa_ok($input, $obj, "$name is $obj") or next;
+        if (defined $value) {
+            is($input->value, $value, "$name is $value");
+        } else {
+            ok(!(defined $input->value), "$name is undef") 
+                or diag "$name is '" . $input->value . "'";
+        }
+    }
+    my @inputs = $form->inputs;
+    is(@inputs, scalar @$input_fields_ref);
+    #foreach my $i (@inputs) {    diag $i->name; }
+}
+
+

Modified: trunk/templates/mypan.tmpl
===================================================================
--- trunk/templates/mypan.tmpl	2006-08-29 12:14:49 UTC (rev 183)
+++ trunk/templates/mypan.tmpl	2006-08-29 12:14:57 UTC (rev 184)
@@ -36,7 +36,7 @@
 </tr>
 </TMPL_LOOP>
 <tr>
-  <td><input name="name" size="20">
+  <td><input name="name" size="20" />
       <select name="type">
         <option value=""></option>
         <option value="distro">Distribution</option>
@@ -56,7 +56,7 @@
 but probably a thread you are interested in.
 </p>
 <p>
-<input type="submit" value="Update" />
+<input name="submit" type="submit" value="Update" />
 </p>
 </form>
 

Modified: trunk/www/robots.txt
===================================================================
--- trunk/www/robots.txt	2006-08-29 12:14:49 UTC (rev 183)
+++ trunk/www/robots.txt	2006-08-29 12:14:57 UTC (rev 184)
@@ -2,4 +2,7 @@
 Disallow: /mypan/
 Disallow: /new_post/
 Disallow: /admin/
+Disallow: /rss/dist/
+Disallow: /rss/author/
+Disallow: /rss/user/
 



More information about the Cpan-forum-commit mailing list