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 => 20; |
37 |
plan tests => 23; |
38 |
|
38 |
|
39 |
$schema->storage->txn_begin; |
39 |
$schema->storage->txn_begin; |
40 |
|
40 |
|
Lines 120-125
subtest 'list() tests' => sub {
Link Here
|
120 |
$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) |
121 |
->json_is( [ $additional_field->to_api, $another_additional_field->to_api ] ); |
121 |
->json_is( [ $additional_field->to_api, $another_additional_field->to_api ] ); |
122 |
|
122 |
|
|
|
123 |
# Filtering works for unmapped tablename |
124 |
$t->get_ok("//$userid:$password@/api/v1/extended_attribute_types?resource_type=subscription")->status_is(200) |
125 |
->json_is( [ $additional_field_yet_another_different_tablename->to_api ] ); |
126 |
|
123 |
# Warn on unsupported query parameter |
127 |
# Warn on unsupported query parameter |
124 |
$t->get_ok("//$userid:$password@/api/v1/extended_attribute_types?blah=blah")->status_is(400) |
128 |
$t->get_ok("//$userid:$password@/api/v1/extended_attribute_types?blah=blah")->status_is(400) |
125 |
->json_is( [ { path => '/query/blah', message => 'Malformed query string' } ] ); |
129 |
->json_is( [ { path => '/query/blah', message => 'Malformed query string' } ] ); |
126 |
- |
|
|