Index: openacs-4/packages/forums/tcl/test/forums-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/test/forums-procs.tcl,v diff -u -r1.1.4.1 -r1.1.4.2 --- openacs-4/packages/forums/tcl/test/forums-procs.tcl 23 Dec 2004 02:12:54 -0000 1.1.4.1 +++ openacs-4/packages/forums/tcl/test/forums-procs.tcl 20 Jul 2005 17:55:26 -0000 1.1.4.2 @@ -144,3 +144,121 @@ aa_equals "After deletion moderated forum has zero threads" $forum(thread_count) 0 } } + + +aa_register_case -cats {web smoke} forum_new_web { + Testing the creation of a forum via web +} { + +aa_run_with_teardown -test_code { + + tclwebtest::cookies clear + # Login user + array set user_info [twt::user::create -admin] + twt::user::login $user_info(email) $user_info(password) + + # Create a new forum + set name [ad_generate_random_string] + forums::twt::new "$name" + } + +} + +aa_register_case -cats {web smoke} forum_edit { + Testing the edition of an existing forum +} { + + +aa_run_with_teardown -test_code { + + tclwebtest::cookies clear + # Login user + array set user_info [twt::user::create -admin] + twt::user::login $user_info(email) $user_info(password) + + # Create a forum + set name [ad_generate_random_string] + forums::twt::new "$name" + # Edit the created forum + forums::twt::edit "$name" + twt::user::logout +} +} + +aa_register_case -cats {web smoke} message_new { + Posting a new message to an existing forum +} { + tclwebtest::cookies clear + # Login user + array set user_info [twt::user::create -admin] + twt::user::login $user_info(email) $user_info(password) + + # Create a forum + set name [ad_generate_random_string] + set subject [ad_generate_random_string] + forums::twt::new "$name" + # Post a message in the created forum + forums::twt::new_post "$name" "$subject" + + twt::user::logout +} + +aa_register_case -cats {web smoke} message_edit { + Editing a message of a forum +} { + tclwebtest::cookies clear + # Login user + array set user_info [twt::user::create -admin] + twt::user::login $user_info(email) $user_info(password) + + # Create a forum + set subject [ad_generate_random_string] + set name [ad_generate_random_string] + forums::twt::new "$name" + # Post a message in the created forum + forums::twt::new_post "$name" "$subject" + # Edit the posted message + forums::twt::edit_post "$name" "$subject" + + twt::user::logout +} + +aa_register_case -cats {web smoke} message_reply { + Post a reply a message in the forum +} { + tclwebtest::cookies clear + # Login user + array set user_info [twt::user::create -admin] + twt::user::login $user_info(email) $user_info(password) + + # Create a forum + set subject [ad_generate_random_string] + set name [ad_generate_random_string] + forums::twt::new "$name" + # Post a message in the created forum + forums::twt::new_post "$name" "$subject" + # Edit the posted message + forums::twt::reply_msg "$name" "$subject" + + twt::user::logout +} + +aa_register_case -cats {web smoke} message_delete { + Delete a message in the forum +} { + tclwebtest::cookies clear + # Login user + array set user_info [twt::user::create -admin] + twt::user::login $user_info(email) $user_info(password) + + # Create a forum + set subject [ad_generate_random_string] + set name [ad_generate_random_string] + forums::twt::new "$name" + # Post a message in the created forum + forums::twt::new_post "$name" "$subject" + # Edit the posted message + forums::twt::delete_post "$name" "$subject" + + twt::user::logout +} \ No newline at end of file