Business-Mondo
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
Revision history for Business-Mondo
0.06 2015-08-21
- live API test is absorbed into emulated test so can run the same
test against both live and emulated endpoints
0.05 2015-07-22
- Use Any type for Booleans as some test failures with Bool related
to incorrect coercion (?) of JSON::PP boolean types (GH #4)
0.04 2015-05-28
- Add missing attributes to Transaction and Merchant objects (GH #3)
0.03 2015-05-22
- Kwalitee improvements
mondo_emulator.pl view on Meta::CPAN
post '/attachment/deregister' => sub {
my ( $c ) = @_;
my $id = $c->param( 'id' )
|| return $c->render( status => 400, text => "id required" );
$c->render( json => {} );
}
};
# convenience methods for file upload emulation, these endpoints
# do not exist in the Mondo API, they are here to fake uploads
get '/file/:entity_id/:file_name' => sub {
my ( $c ) = @_;
$c->render( text => "OK" );
};
post '/upload/:entity_id/:file_name' => sub {
my ( $c ) = @_;
t/business/mondo.t view on Meta::CPAN
client
transactions
transaction
accounts
/,
);
isa_ok( $Mondo->client,'Business::Mondo::Client' );
# monkey patching Mojo::UserAgent here to make this test work without
# having to actually hit the endpoints or use credentials
no warnings 'redefine';
no warnings 'once';
my $mock = Test::MockObject->new;
$mock->mock( 'success',sub { 1 } );
$mock->mock( 'headers',sub { $mock } );
$mock->mock( 'res',sub { $mock } );
$mock->mock( 'json',sub { $mock } );
*Mojo::UserAgent::post = sub { $mock };
*Mojo::UserAgent::put = sub { $mock };
*Mojo::UserAgent::patch = sub { $mock };
view all matches for this distributionview release on metacpan - search on metacpan
( run in 0.599 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )