Index: openacs-4/packages/forums/forums.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/forums.info,v
diff -u -r1.56.2.2 -r1.56.2.3
--- openacs-4/packages/forums/forums.info 21 Mar 2019 15:58:18 -0000 1.56.2.2
+++ openacs-4/packages/forums/forums.info 9 Apr 2019 14:33:55 -0000 1.56.2.3
@@ -9,7 +9,7 @@
f
t
-
+
OpenACS
Online discussion forums.
2017-08-06
@@ -19,14 +19,14 @@
2
#forums.Forums#
-
+
-
+
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.11 -r1.11.2.1
--- openacs-4/packages/forums/tcl/test/forums-procs.tcl 24 Jul 2018 17:19:58 -0000 1.11
+++ openacs-4/packages/forums/tcl/test/forums-procs.tcl 9 Apr 2019 14:33:55 -0000 1.11.2.1
@@ -195,7 +195,8 @@
# Create a new forum
#
set name [ad_generate_random_string]
- set forum_id [forums::test::new -user_id $user_id $name]
+ set d [forums::test::new -user_id $user_id $name]
+ set forum_id [dict get $d payload forum_id]
} -teardown_code {
@@ -233,19 +234,22 @@
# Create a new forum
#
set name [ad_generate_random_string]
- set forum_id [forums::test::new -user_id $user_id $name]
+ set d [forums::test::new -user_id $user_id $name]
+ set forum_id [dict get $d payload forum_id]
aa_log "Created forum with id $forum_id"
#
# View a forum via name.
#
set response [forums::test::view \
+ -last_request $d \
-user_id $user_id \
-name $name ]
#
# View a forum via forum_id.
#
set response [forums::test::view \
+ -last_request $d \
-user_id $user_id \
-forum_id $forum_id ]
@@ -283,13 +287,14 @@
# Create a new forum
#
set name [ad_generate_random_string]
- set forum_id [forums::test::new -user_id $user_id $name]
+ set d [forums::test::new -user_id $user_id $name]
+ set forum_id [dict get $d payload forum_id]
#
# Edit the meta info of the created forum
#
set response [forums::test::edit \
- -user_id $user_id \
+ -last_request $d \
-forum_id $forum_id ]
} -teardown_code {
@@ -345,11 +350,12 @@
# Create a new forum
#
set name [ad_generate_random_string]
- set forum_id [forums::test::new -user_id $user_id $name]
+ set d [forums::test::new -user_id $user_id $name]
+ set forum_id [dict get $d payload forum_id]
# Post a message in the created forum
set message_id [forums::test::new_postings \
- -user_id $user_id \
+ -last_request $d \
-forum_id $forum_id ]
Index: openacs-4/packages/forums/tcl/test/webtest-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/test/webtest-procs.tcl,v
diff -u -r1.2.2.1 -r1.2.2.2
--- openacs-4/packages/forums/tcl/test/webtest-procs.tcl 22 Mar 2019 12:56:17 -0000 1.2.2.1
+++ openacs-4/packages/forums/tcl/test/webtest-procs.tcl 9 Apr 2019 14:33:55 -0000 1.2.2.2
@@ -35,7 +35,7 @@
# Fill in a few values into the form
#
set d [::acs::test::form_reply \
- -user_id $user_id \
+ -last_request $d \
-url [dict get $form_data @action] \
-update [subst {
name "$name"
@@ -53,11 +53,13 @@
acs::test::reply_contains_no $d form-error
aa_equals "Status code valid" [dict get $d status] 302
- return [dict get $form_data fields forum_id]
+ dict set d payload forum_id [dict get $form_data fields forum_id]
+
+ return $d
}
ad_proc -private view {
- {-user_id 0}
+ {-last_request ""}
{-forum_id 0}
{-name ""}
} {
@@ -69,17 +71,16 @@
#
# Call to the forums page
#
- set d [::acs::test::http -user_id $user_id $forums_page]
+ set d [::acs::test::http -last_request $last_request $forums_page]
aa_equals "Status code valid" [dict get $d status] 200
#
# Follow the link with the provided link label
#
set d [::acs::test::follow_link \
- -user_id $user_id \
+ -last_request $d \
-base $forums_page \
- -label $name \
- -html [dict get $d body]]
+ -label $name]
aa_equals "Status code valid" [dict get $d status] 200
}
@@ -89,23 +90,23 @@
if {$forum_id != 0} {
aa_log "check via forum_id"
set d [::acs::test::http \
- -user_id $user_id \
+ -last_request $d \
$forums_page/forum-view?forum_id=$forum_id]
aa_equals "Status code valid" [dict get $d status] 200
}
return $d
}
ad_proc -private edit {
- {-user_id 0}
+ {-last_request:required}
{-forum_id 0}
} {
Edit a forum via the web interface.
} {
set forums_page [aa_get_first_url -package_key forums]
set d [acs::test::http \
- -user_id $user_id \
+ -last_request $last_request \
$forums_page/admin/forum-edit?forum_id=$forum_id]
aa_equals "Status code valid" [dict get $d status] 200
@@ -122,23 +123,23 @@
set new_name "Edited $old_name"
set new_charter "Edited $old_charter"
set d [::acs::test::form_reply \
- -user_id $user_id \
+ -last_request $d \
-url [dict get $form_data @action] \
-update [subst {
- name "$new_name"
- charter "$new_charter"
+ name "$new_name"
+ charter "$new_charter"
}] \
[dict get $form_data fields]]
if {[acs::test::reply_contains_no $d form-error]} {
- set d [acs::test::http -user_id $user_id $forums_page]
+ set d [acs::test::http -last_request $d $forums_page]
acs::test::reply_contains -prefix "Overview page" $d $new_name
acs::test::reply_contains -prefix "Overview page" $d $new_charter
}
}
ad_proc -private new_postings {
- {-user_id 0}
+ {-last_request ""}
{-forum_id 0}
} {
Add a posting to the provided forum via the web interface.
@@ -149,7 +150,7 @@
set forums_page [aa_get_first_url -package_key forums]
set d [acs::test::http \
- -user_id $user_id \
+ -last_request $last_request \
$forums_page/message-post?forum_id=$forum_id]
aa_equals "Edit Message: Status code valid" [dict get $d status] 200
@@ -166,7 +167,7 @@
set message_body "body [ad_generate_random_string 20]"
set d [::acs::test::form_reply \
- -user_id $user_id \
+ -last_request $last_request \
-url [dict get $form_data @action] \
-update [subst {
subject "$subject"
@@ -184,15 +185,15 @@
#
# Check on the forums overview page, if we find the new subject
#
- set d [acs::test::http -user_id $user_id $forums_page/forum-view?forum_id=$forum_id]
+ set d [acs::test::http -last_request $d $forums_page/forum-view?forum_id=$forum_id]
aa_equals "View Forum: Status code valid" [dict get $d status] 200
acs::test::reply_contains $d $subject
#
# Check on the forums view page, if we find the new subject and the new body
#
- set d [acs::test::http -user_id $user_id $forums_page/message-view?message_id=$message_id]
+ set d [acs::test::http -last_request $d $forums_page/message-view?message_id=$message_id]
aa_equals "View Message: Status code valid" [dict get $d status] 200
acs::test::reply_contains $d $subject
@@ -201,13 +202,13 @@
#
# Post a reply to the last message
#
- set d [acs::test::http -user_id $user_id $forums_page/message-post?parent_id=$message_id]
+ set d [acs::test::http -last_request $d $forums_page/message-post?parent_id=$message_id]
set form_data [::acs::test::get_form [dict get $d body] {//form[@id="message"]}]
aa_true "Found form on edit page for posting reply" {[llength $form_data] > 0}
set reply_message_id [dict get $form_data fields message_id]
set d [::acs::test::form_reply \
- -user_id $user_id \
+ -last_request $d \
-url [dict get $form_data @action] \
-update [subst {
message_body "REPLY $message_body"
@@ -220,22 +221,22 @@
#
# The reply should show up on the forums thread page
#
- set d [acs::test::http -user_id $user_id $forums_page/message-view?message_id=$message_id]
+ set d [acs::test::http -last_request $d $forums_page/message-view?message_id=$message_id]
aa_equals "Message overview: Status code valid" [dict get $d status] 200
acs::test::reply_contains $d "REPLY $message_body"
#
# Edit the reply
#
- set d [acs::test::http -user_id $user_id $forums_page/moderate/message-edit?message_id=$reply_message_id]
+ set d [acs::test::http -last_request $d $forums_page/moderate/message-edit?message_id=$reply_message_id]
set form_data [::acs::test::get_form [dict get $d body] {//form[@id="message"]}]
aa_true "Found form on edit page for editing reply" {[llength $form_data] > 0}
set old_reply_message_body [dict get $form_data fields message_body]
set new_reply_message_body "$old_reply_message_body EDITED"
aa_true "old message_body contains REPLY" [string match "*REPLY*" $old_reply_message_body]
set d [::acs::test::form_reply \
- -user_id $user_id \
+ -last_request $d \
-url [dict get $form_data @action] \
-update [subst {
message_body "$new_reply_message_body"
@@ -247,29 +248,28 @@
#
# The edited reply should show up on the forums thread page
#
- set d [acs::test::http -user_id $user_id $forums_page/message-view?message_id=$message_id]
+ set d [acs::test::http -last_request $d $forums_page/message-view?message_id=$message_id]
aa_equals "Message overview: Status code valid" [dict get $d status] 200
acs::test::reply_contains $d "$new_reply_message_body"
#
# Delete the reply
#
set request [export_vars -sign -base ${forums_page}/moderate/message-delete {{message_id $reply_message_id}}]
- set d [acs::test::http -user_id $user_id $request]
+ set d [acs::test::http -last_request $d $request]
aa_equals "Message overview: Status code valid" [dict get $d status] 200
acs::test::reply_contains $d message-delete?confirm_p
set d [::acs::test::follow_link \
- -user_id $user_id \
+ -last_request $d \
-base $forums_page/moderate \
- -label Yes \
- -html [dict get $d body]]
+ -label Yes]
aa_equals "Message overview: Status code valid" [dict get $d status] 302
#
# The edited reply should no show up up on the forums thread page
#
- set d [acs::test::http -user_id $user_id $forums_page/message-view?message_id=$message_id]
+ set d [acs::test::http -last_request $d $forums_page/message-view?message_id=$message_id]
aa_equals "Message overview: Status code valid" [dict get $d status] 200
acs::test::reply_contains_no $d "$new_reply_message_body"