diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-03-21 17:59:35 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-03-21 17:59:57 +0000 |
commit | 96d6d115c68d5e0a4b23612aa630c3e0de98daa5 (patch) | |
tree | 93aa6300294959b9dff69c54c179bf0f2b851b74 /t/open311 | |
parent | 129de99f4c042cf9f9cb4a25cc3f5bb5c40077c3 (diff) |
Store server_set automated, but ignore for input.
We do need to store them, so that the sending knows which fields are being
requested, but we do not want them output to the client at all.
Diffstat (limited to 't/open311')
-rw-r--r-- | t/open311/populate-service-list.t | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/t/open311/populate-service-list.t b/t/open311/populate-service-list.t index 149fb4b2a..7d4f491c6 100644 --- a/t/open311/populate-service-list.t +++ b/t/open311/populate-service-list.t @@ -646,96 +646,6 @@ subtest 'check bromely skip code' => sub { is_deeply $contact->get_extra_fields, $extra, 'all meta data saved for non bromley'; }; -subtest 'check automated meta skip code' => sub { - my $processor = Open311::PopulateServiceList->new(); - - my $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> - <attribute> - <automated>server_set</automated> - <variable>true</variable> - <code>title</code> - <datatype>string</datatype> - <required>true</required> - <datatype_description>Type of bin</datatype_description> - <order>1</order> - <description>Type of bin</description> - </attribute> - <attribute> - <automated>hidden_field</automated> - <variable>true</variable> - <code>asset_id</code> - <datatype>string</datatype> - <required>true</required> - <datatype_description>Id of bin</datatype_description> - <order>1</order> - <description>Id of bin</description> - </attribute> - </attributes> -</service_definition> - '; - - my $contact = FixMyStreet::DB->resultset('Contact')->find_or_create( - { - body_id => 1, - email => '001', - category => 'Bins left out 24x7', - state => 'confirmed', - editor => $0, - whenedited => \'current_timestamp', - note => 'test contact', - } - ); - - my $o = Open311->new( - jurisdiction => 'mysociety', - endpoint => 'http://example.com', - test_mode => 1, - test_get_returns => { 'services/100.xml' => $meta_xml } - ); - - $processor->_current_open311( $o ); - $processor->_current_body( $body ); - $processor->_current_service( { service_code => 100 } ); - - $processor->_add_meta_to_contact( $contact ); - - my $extra = [ { - variable => 'true', - code => 'type', - datatype => 'string', - required => 'true', - datatype_description => 'Type of bin', - order => 1, - description => 'Type of bin' - }, - { - automated => 'hidden_field', - variable => 'true', - code => 'asset_id', - datatype => 'string', - required => 'true', - datatype_description => 'Id of bin', - order => 1, - description => 'Id of bin' - } ]; - - $contact->discard_changes; - - is_deeply $contact->get_extra_fields, $extra, 'only hidden automated meta data saved'; -}; - sub get_standard_xml { return qq{<?xml version="1.0" encoding="utf-8"?> <services> |