[Rt-commit] rt 05/05: Add tests for class change with taken name

Jim Brandt jbrandt at bestpractical.com
Fri Jul 9 11:54:24 EDT 2021


This is an automated email from the git hooks/post-receive script.

jbrandt pushed a commit to branch 5.0/articles-unique-only-within-own-class2
in repository rt.

commit 088b36496f1a4a176b16baf2a98d3593be053b22
Author: Jim Brandt <jbrandt at bestpractical.com>
AuthorDate: Fri Jul 9 11:42:21 2021 -0400

    Add tests for class change with taken name
---
 t/articles/article.t | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/t/articles/article.t b/t/articles/article.t
index cf67ba6a19..1c7b90c433 100644
--- a/t/articles/article.t
+++ b/t/articles/article.t
@@ -109,7 +109,16 @@ ok (!$id, $msg);
 my $a6 = RT::Article->new($RT::SystemUser);
 ($id, $msg) = $a6->Create(Class => $class2->id, Name => "ScopedClassTest$$" );
 ok ($id, $msg);
+is ($a6->ClassObj->Name, $class2->Name, 'Class name is ' . $class2->Name);
 
+# Can't change class if Name is used in destination class
+($val, $msg) = $a6->SetClass($class1->id);
+ok (!$val, $msg);
+
+($val, $msg) = $a6->SetName('Changed name');
+ok ($val, $msg);
+($val, $msg) = $a6->SetClass($class1->id);
+ok ($val, $msg);
 
 
 # NOT OK

-- 
To stop receiving notification emails like this one, please contact
sysadmin at bestpractical.com.


More information about the rt-commit mailing list