[Yapcom-commit] rev 74 - / lib/YAPC t

[prev] [thread] [next] [lurker] [Date index for 2003/11/27]

From: svn
Subject: [Yapcom-commit] rev 74 - / lib/YAPC t
Date: 09:38 on 27 Nov 2003
Author: gabor
Date: 2003-11-27 09:38:52 +0200 (Thu, 27 Nov 2003)
New Revision: 74

Modified:
   MANIFEST
   README
   lib/YAPC/Organizer.pm
   lib/YAPC/Talk.pm
   t/04-proposals.t
Log:
fixing problem that people could not submit new proposal becaus of the new capability to changea proposal

Modified: MANIFEST
===================================================================
--- MANIFEST	2003-11-27 06:54:59 UTC (rev 73)
+++ MANIFEST	2003-11-27 07:38:52 UTC (rev 74)
@@ -30,6 +30,7 @@
 t/09-web-change-password.t        no
 t/10-use-html-template.t          no
 t/11-web-admin.t                  no
+t/13-change-proposal.t            no
 t/lib/YAPC/Test.pm                no
 t/lib/YAPC/Test/Data.pm           no
 templates/error.tmpl
@@ -67,6 +68,7 @@
 templates/message.tmpl
 templates/presentations.tmpl
 templates/speakers.tmpl
+templates/list_my_proposals.tmpl
 docs/announcement_call_for_papers_hebrew.doc
 docs/announcement_call_for_papers_english.doc
 docs/sponsorship_letter_hebrew.doc

Modified: README
===================================================================
--- README	2003-11-27 06:54:59 UTC (rev 73)
+++ README	2003-11-27 07:38:52 UTC (rev 74)
@@ -53,6 +53,14 @@
 
 CHANGES
 ---------
+0.09  2003.11.27
+    - create XML compilant HTML pages
+    - enable logged in users to change their proposals 
+
+0.08_03  2003.11.26
+    - Enable the use of a local configuration file.
+    - fix minor issues
+
 0.08_01  2003.11.26
     - form (for logged in user) to change the personal information registerd 
 
@@ -190,6 +198,11 @@
     - improve error messages on the web site
     - give error message on validation form if something went wrong
 
+    - Shall we use Error.pm for exception handling ?
+    - Shall we use some Form Validator module ?
+         WWW::Form, CGI::Formmagick , else ?
+
+
 Intermediate (needs database change)
 
     - on the list_people page show stat of how many people have paid already.
@@ -226,7 +239,8 @@
     - in the installation process change the content of the configuration file.
       including the installation directory. (or should it be a PREFIX ?)
 
-    - Enable the use of a local configuration file.
+    - Improve the use of a local configuration file based on Timesink of Richard
+      http://unixbeard.net/svn/richardc/timesink/lib/Timesink/Config.pm
 
     - Implement the timeout of the logins
 
@@ -253,6 +267,21 @@
   it can be seen when running the cgi/yapc.pl script
   actually I think non of the pages will respond
 
+- When running the tests sometimes I stop them in the middle by Ctrl-C.
+  In such cases the database usually becomes corrupted.
+ 
+  I get an error message like this when I try to run the tests again:
+ 
+  Ima::DBI connect('t/test.db','',...) failed: database disk image is
+  malformed
+ 
+ 
+  How can we make sure that this will not happen in the real system ?
+  How can we write a test that will cause the above problem (even if that
+  test has to run 10 times to have good chances to one corruption)
+  so we can see when our script is good enough ?
+
+
 the rest of the known bugs are in the TODO list.
 
 

Modified: lib/YAPC/Organizer.pm
===================================================================
--- lib/YAPC/Organizer.pm	2003-11-27 06:54:59 UTC (rev 73)
+++ lib/YAPC/Organizer.pm	2003-11-27 07:38:52 UTC (rev 74)
@@ -1,6 +1,6 @@
 package YAPC::Organizer;
 
-our $VERSION = '0.08_03';
+our $VERSION = '0.09';
 
 use strict;
 use warnings;

Modified: lib/YAPC/Talk.pm
===================================================================
--- lib/YAPC/Talk.pm	2003-11-27 06:54:59 UTC (rev 73)
+++ lib/YAPC/Talk.pm	2003-11-27 07:38:52 UTC (rev 74)
@@ -18,7 +18,8 @@
     my $self = shift;
     my %args = $self->_check_values(@_); 
 
-    croak("id should not be defined\n") if defined $args{id};
+    #croak("id should not be defined\n") if defined $args{id};
+    delete $args{id};
 
     __PACKAGE__->create(\%args);
 }

Modified: t/04-proposals.t
===================================================================
--- t/04-proposals.t	2003-11-27 06:54:59 UTC (rev 73)
+++ t/04-proposals.t	2003-11-27 07:38:52 UTC (rev 74)
@@ -87,8 +87,48 @@
    is($talks[1]->title, $prop{subject}, 'The title was recorded correctly');
 }
 
+###### Submit a third proposal with a valid cookie and and the id field set to ''
+{
+   my %prop = %proposal;
+   $prop{subject}    = q(akdjakhdsakf);
+   $prop{length}   = 90;
+   $prop{id}   = '';
+   YAPC::Talk->propose(%prop);
+   my @talks = YAPC::Talk->retrieve_all;
+   is(@talks, 3, 'There are now two talks in the database'); 
+   is($talks[0]->title, $proposal{subject}, 'The title was recorded correctly');
+   is($talks[2]->title, $prop{subject}, 'The title was recorded correctly');
+}
 
+###### Submit a third proposal with a valid cookie and and the id field set to 1 an exising talk id
+{
+   my %prop = %proposal;
+   $prop{subject}    = YAPC::DBI->_random_string(20);
+   $prop{length}   = 90;
+   $prop{id}   = 1;
+   YAPC::Talk->propose(%prop);
+   my @talks = YAPC::Talk->retrieve_all;
+   is(@talks, 4, 'There are now two talks in the database'); 
+   is($talks[0]->title, $proposal{subject}, 'The title was recorded correctly');
+   is($talks[-1]->title, $prop{subject}, 'The title was recorded correctly');
+}
 
+###### Submit a third proposal with a valid cookie and and the id field set to 9 a not exising talk id
+{
+   my %prop = %proposal;
+   $prop{subject}    = YAPC::DBI->_random_string(20);
+   $prop{length}   = 90;
+   $prop{id}   = 9;
+   YAPC::Talk->propose(%prop);
+   my @talks = YAPC::Talk->retrieve_all;
+   is(@talks, 5, 'There are now two talks in the database'); 
+   is($talks[0]->title, $proposal{subject}, 'The title was recorded correctly');
+   is($talks[-1]->title, $prop{subject}, 'The title was recorded correctly');
+}
+
+
+
+
 ######## logout from the system (remove cookie from the database)
 my $ret = YAPC::Login->logout(cookie => $work_cookie);
 is($ret,1,'logout returned true');

Generated at 10:06 on 27 Nov 2003 by mariachi 0.51