[Rt-commit] rt branch, 4.6/core-group-management-extensions, repushed
Blaine Motsinger
blaine at bestpractical.com
Fri May 31 19:24:20 EDT 2019
The branch 4.6/core-group-management-extensions was deleted and repushed:
was 789d1de16893138a2e04b10bd92cffa7adbb78a4
now 523b6bb6caad9be6b019149869a86c34fc210831
1: 5619366f5 = 1: 5619366f5 Core RT-Extension-GroupLinks
2: d9b9d1d97 = 2: d9b9d1d97 Core RT-Extension-GroupSummary
3: c61bca7bb = 3: c61bca7bb Core RT-Extension-GroupSelfService
4: 789d1de16 ! 4: 523b6bb6c Fix tests for initialdata change
@@ -4,6 +4,66 @@
Use the custom field id created through the tests instead of the
previously hardcoded values.
+
+diff --git a/t/api/customfield.t b/t/api/customfield.t
+--- a/t/api/customfield.t
++++ b/t/api/customfield.t
+@@
+
+ use_ok('RT::CustomField');
+
++# store the cf_id for loading instead of the magic #2
++my $cf_id;
++
+ my $queue = RT::Queue->new( RT->SystemUser );
+ $queue->Load( "General" );
+ ok( $queue->id, "found the General queue" );
+@@
+ ok($cf->SingleValue, "Also a single-value CF");
+ is($cf->MaxValues, 1, "...meaning only one value, max");
+
++# set $cf_id for loading later
++$cf_id = $cf->id;
++
+ ($ok, $msg) = $cf->SetMaxValues('0');
+ ok($ok, "Set to infinite values: $msg");
+ is($cf->Type, 'Select', "Still a select CF");
+@@
+ ok( ! $ok, "Correctly could not create with bogus type: $msg");
+
+ # Test adding and removing CFVs
+-$cf->Load(2);
++$cf->Load($cf_id);
+ ($ok, $msg) = $cf->AddValue(Name => 'foo' , Description => 'TestCFValue', SortOrder => '6');
+ ok($ok, "Added a new value to the select options");
+ ($ok, $msg) = $cf->DeleteValue($ok);
+@@
+
+
+ # Make it only apply to one queue
+-$cf->Load(2);
++$cf->Load($cf_id);
+ my $ocf = RT::ObjectCustomField->new( RT->SystemUser );
+ ( $ok, $msg ) = $ocf->LoadByCols( CustomField => $cf->id, ObjectId => 0 );
+ ok( $ok, "Found global application of CF" );
+@@
+
+
+ # Change the lookup type to be a _user_ CF
+-$cf->Load(2);
++$cf->Load($cf_id);
+ ($ok, $msg) = $cf->SetLookupType( RT::User->CustomFieldLookupType );
+ ok($ok, "Changed CF type to be a CF on users" );
+ $ocf = RT::ObjectCustomField->new( RT->SystemUser );
+@@
+
+
+ # Add a second, queue-specific CF to test load order
+-$cf->Load(2);
++$cf->Load($cf_id);
+ ($ok, $msg) = $cf->SetLookupType( RT::Ticket->CustomFieldLookupType );
+ ok($ok, "Changed CF type back to be a CF on tickets" );
+ $ocf = RT::ObjectCustomField->new( RT->SystemUser );
diff --git a/t/web/cf_image.t b/t/web/cf_image.t
--- a/t/web/cf_image.t
More information about the rt-commit
mailing list