1#!perl -t
2
3use warnings;
4use strict;
5use Test::More;
6use Test::Deep;
7
8use lib "t/lib";
9use Test::MockPushover;
10
11
12use_ok "WebService::Pushover" or BAIL_OUT "WebService::Pushover failed. Cannot continue testing";
13
14my $API_TOKEN  = "abcdefghijklmnopqrstuvwxyz1234";
15my $USER_TOKEN = "1234abcdefghijklmnopqrstuvwxyz";
16
17spin_mock_server(user_token => $USER_TOKEN, api_token => $API_TOKEN);
18
19my $user  = '0123abcdefghijklmnopqrstuvwxyz';
20my $token = 'abcdefghijklmnopqrstuvwxyz0123';
21
22pushover_ok 'receipt', {
23	receipt => 'myreceipt001234567890123456789',
24	token   => $token,
25},{
26	headers => ignore,
27	path    => '/1/receipts/myreceipt001234567890123456789.json',
28	data    => {
29		token   => $token,
30	},
31}, "passing tokens to receipts() overrides the built-ins";
32
33pushover_ok 'receipt', {
34	receipt => 'myreceipt001234567890123456789',
35},{
36	headers => ignore,
37	path    => '/1/receipts/myreceipt001234567890123456789.json',
38	data    => {
39		token   => $API_TOKEN,
40	},
41}, "passing no token/user to receipts() uses built-ins";
42
43done_testing;
44