4 use Test::More tests => 4;
6 my $FS = FS::Test->new;
8 $FS->post('/edit/cust_main.cgi');
9 my $form = $FS->form('CustomerForm');
12 residential_commercial => 'Residential',
17 invoice_email => 'newcustomer@fake.freeside.biz',
18 bill_address1 => '123 Example Street',
19 bill_address2 => 'Apt. Z',
20 bill_city => 'Sacramento',
24 bill_coord_auto => 'Y',
25 daytime => '916-555-0100',
26 night => '916-555-0200',
27 ship_address1 => '125 Example Street',
28 ship_address2 => '3rd Floor',
29 ship_city => 'Sacramento',
33 ship_coord_auto => 'Y',
34 invoice_ship_address => 'Y',
35 postal_invoice => 'Y',
39 custpaybynum0_payby => 'CARD',
40 custpaybynum0_payinfo => '4012888888881881',
41 custpaybynum0_paydate_month => '12',
42 custpaybynum0_paydate_year => '2020',
43 custpaybynum0_paycvv => '123',
44 custpaybynum0_payname => '',
45 custpaybynum0_weight => 1,
47 foreach (keys %params) {
48 $form->value($_, $params{$_});
51 ok( $FS->error eq '' , 'form posted' );
53 ok($FS->redirect =~ m[^/view/cust_main.cgi\?(\d+)], 'new customer accepted')
56 my $cust = $FS->qsearchs('cust_main', { custnum => $1 });
57 isa_ok ( $cust, 'FS::cust_main' );
58 $FS->post($FS->redirect);
59 ok ( $FS->error eq '' , 'can view customer' );
61 # try to display the error message, or if not, show everything
62 $FS->post($FS->redirect);