View | Details | Raw Unified | Return to bug 37261
Collapse All | Expand All

(-)a/t/db_dependent/api/v1/extended_attribute_types.t (-2 / +19 lines)
Lines 34-40 t::lib::Mocks::mock_preference( 'RESTBasicAuth', 1 ); Link Here
34
34
35
subtest 'list() tests' => sub {
35
subtest 'list() tests' => sub {
36
36
37
    plan tests => 17;
37
    plan tests => 20;
38
38
39
    $schema->storage->txn_begin;
39
    $schema->storage->txn_begin;
40
40
Lines 98-103 subtest 'list() tests' => sub { Link Here
98
        ]
98
        ]
99
    );
99
    );
100
100
101
    my $additional_field_yet_another_different_tablename = $builder->build_object(
102
        {
103
            class => 'Koha::AdditionalFields',
104
            value => { tablename => 'subscription', name => 'fourth_af_name' },
105
        }
106
    );
107
108
    # Four additional fields created, they should both be returned
109
    $t->get_ok("//$userid:$password@/api/v1/extended_attribute_types")
110
      ->status_is(200)->json_is(
111
        [
112
            $additional_field->to_api,
113
            $another_additional_field->to_api,
114
            $additional_field_different_tablename->to_api,
115
            $additional_field_yet_another_different_tablename->to_api,
116
        ]
117
      );
118
101
    # Filtering works, two existing additional fields returned for the queried table name
119
    # Filtering works, two existing additional fields returned for the queried table name
102
    $t->get_ok("//$userid:$password@/api/v1/extended_attribute_types?resource_type=invoice")->status_is(200)
120
    $t->get_ok("//$userid:$password@/api/v1/extended_attribute_types?resource_type=invoice")->status_is(200)
103
        ->json_is( [ $additional_field->to_api, $another_additional_field->to_api ] );
121
        ->json_is( [ $additional_field->to_api, $another_additional_field->to_api ] );
104
- 

Return to bug 37261