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.2 -r1.2.2.1 --- openacs-4/packages/forums/tcl/test/forums-procs.tcl 13 Jan 2005 13:58:16 -0000 1.2 +++ openacs-4/packages/forums/tcl/test/forums-procs.tcl 26 Sep 2005 09:03:14 -0000 1.2.2.1 @@ -144,3 +144,120 @@ aa_equals "After deletion moderated forum has zero threads" $forum(thread_count) 0 } } + + +aa_register_case -cats {web smoke} web_forum_new { + 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] + set response [forums::twt::new "$name"] + aa_display_result -response $response -explanation {Webtest for the creation of a new Forum} + } + +} + +aa_register_case -cats {web smoke} web_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 + set response [forums::twt::edit "$name"] + aa_display_result -response $response -explanation {Webtest for the edition of a forum} + twt::user::logout + } +} + +aa_register_case -cats {web smoke} web_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 + set response [forums::twt::new_post "$name" "$subject"] + aa_display_result -response $response -explanation {Webtest for posting a message in a forum} + twt::user::logout +} + +aa_register_case -cats {web smoke} web_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 + set response [forums::twt::edit_post "$name" "$subject"] + aa_display_result -response $response -explanation {Webtest for editing the message of a forum} + + twt::user::logout +} + +aa_register_case -cats {web smoke} web_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 + set response [forums::twt::reply_msg "$name" "$subject"] + aa_display_result -response $response -explanation {Webtest for posting a reply to a msg in the forum} + twt::user::logout +} + +aa_register_case -cats {web smoke} web_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 + set response [forums::twt::delete_post "$name" "$subject"] + aa_display_result -response $response -explanation {Webtest for deleting a message posted in the forum} + twt::user::logout +}