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