diff options
Diffstat (limited to 't')
-rw-r--r-- | t/app/controller/admin/reportextrafields.t | 6 | ||||
-rw-r--r-- | t/open311/populate-service-list.t | 128 |
2 files changed, 134 insertions, 0 deletions
diff --git a/t/app/controller/admin/reportextrafields.t b/t/app/controller/admin/reportextrafields.t index e02df864f..6011b13e3 100644 --- a/t/app/controller/admin/reportextrafields.t +++ b/t/app/controller/admin/reportextrafields.t @@ -78,6 +78,7 @@ FixMyStreet::override_config { code => "string_test", required => "true", variable => "true", + protected => "false", description => "this is a test description", datatype_description => "hint here", datatype => "string", @@ -106,6 +107,7 @@ FixMyStreet::override_config { code => "list_test", required => "false", variable => "true", + protected => "false", description => "this field is a list", datatype_description => "", datatype => "singlevaluelist", @@ -142,6 +144,7 @@ FixMyStreet::override_config { description => '', required => 'false', variable => 'true', + protected => 'false', code => 'POT', automated => 'server_set' } ], "automated fields not unset"; @@ -177,6 +180,7 @@ FixMyStreet::override_config { code => "string_test", required => "true", variable => "true", + protected => "false", description => "this is a test description", datatype_description => "hint here", datatype => "string", @@ -204,6 +208,7 @@ FixMyStreet::override_config { code => "list_test", required => "false", variable => "true", + protected => "false", description => "this field is a list", datatype_description => "", datatype => "singlevaluelist", @@ -233,6 +238,7 @@ FixMyStreet::override_config { code => "automated_test", required => "false", variable => "true", + protected => "false", description => "", datatype_description => "", datatype => "string", diff --git a/t/open311/populate-service-list.t b/t/open311/populate-service-list.t index 9f8b4d9f0..3d3144d1f 100644 --- a/t/open311/populate-service-list.t +++ b/t/open311/populate-service-list.t @@ -606,6 +606,134 @@ for my $test ( ', }, { + desc => 'check protected meta data not overwritten', + has_meta => 1, + end_meta => [ { + variable => 'true', + code => 'type', + datatype => 'string', + required => 'true', + datatype_description => 'Bin type', + order => 1, + description => 'Bin type', + protected => 'true' + + } ], + orig_meta => [ { + variable => 'true', + code => 'type', + datatype => 'string', + required => 'true', + datatype_description => 'Bin type', + order => 1, + description => 'Bin type', + protected => 'true' + + } ], + meta_xml => '<?xml version="1.0" encoding="utf-8"?> + <service_definition> + <service_code>100</service_code> + <attributes> + <attribute> + <variable>true</variable> + <code>type</code> + <datatype>string</datatype> + <required>true</required> + <datatype_description>Type of bin</datatype_description> + <order>1</order> + <description>Type of bin</description> + </attribute> + </attributes> + </service_definition> + ', + }, + { + desc => 'check protected meta data retained', + has_meta => 1, + end_meta => [ + { + variable => 'true', + code => 'type2', + datatype => 'string', + required => 'true', + datatype_description => 'Type of bin', + order => 1, + description => 'Type of bin', + + }, + { + variable => 'true', + code => 'type', + datatype => 'string', + required => 'true', + datatype_description => 'Number of bin', + order => 1, + description => 'Number of bin', + protected => 'true' + }, + ], + orig_meta => [ { + variable => 'true', + code => 'type', + datatype => 'string', + required => 'true', + datatype_description => 'Number of bin', + order => 1, + description => 'Number of bin', + protected => 'true' + + } ], + meta_xml => '<?xml version="1.0" encoding="utf-8"?> + <service_definition> + <service_code>100</service_code> + <attributes> + <attribute> + <variable>true</variable> + <code>type2</code> + <datatype>string</datatype> + <required>true</required> + <datatype_description>Type of bin</datatype_description> + <order>1</order> + <description>Type of bin</description> + </attribute> + </attributes> + </service_definition> + ', + }, + { + desc => 'check protected meta data retained on removal of all Open311 extras', + end_meta => [ + { + variable => 'true', + code => 'type', + datatype => 'string', + required => 'true', + datatype_description => 'Number of bin', + order => 1, + description => 'Number of bin', + protected => 'true' + }, + ], + orig_meta => [ { + variable => 'true', + code => 'type', + datatype => 'string', + required => 'true', + datatype_description => 'Number of bin', + order => 1, + description => 'Number of bin', + protected => 'true' + + } ], + meta_xml => '<?xml version="1.0" encoding="utf-8"?> + <service_definition> + <service_code>100</service_code> + <attributes> + </attributes> + </service_definition> + ', + }, + { desc => 'check empty meta data handled', has_meta => 1, orig_meta => [], |