Changeset 3827

Show
Ignore:
Timestamp:
06/09/09 23:39:39 (9 months ago)
Author:
plim
Message:

Refactoring the unit test

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/slapshot/t/101-email.t

    r3823 r3827  
    1818my $user = MT::Author->load(2); 
    1919 
     20# force email to be sent and see if it shows up in stderr 
     21my $app = MT::App->instance; 
     22my $cfg = $app->config; 
     23$cfg->EmailAddressMain('user@example.com', 1); 
     24$cfg->save_config; 
     25 
     26 
    2027my ($app_to_run, $out); 
    2128 
     
    2330$app_to_run = _run_app( 
    2431        'MT::App::CMS', 
    25         { __test_user => $user, __mode => 'cfg_system' } 
     32        { __test_user => $user, __mode => 'cfg_system', to_email_address => 'anotheruser@anotherexample.com' } 
    2633); 
    2734$out = delete $app_to_run->{__test_output}; 
     
    3037ok ($out =~ /Send email to/i, "The email address where you want to send test email to label is present"); 
    3138ok ($out =~ /Send email to/i, "Send test email button is present"); 
    32  
    33 # force email to be sent and see if it shows up in stderr 
    34 my $app = MT::App->instance; 
    35 my $cfg = $app->config; 
    36 $cfg->EmailAddressMain('user@example.com', 1); 
    37 $cfg->save_config; 
    38  
    39 like(grab_stderr( sub { $app_to_run = _run_app( 'MT::App::CMS', { __test_user => $user, __mode => 'cfg_system', to_email_address => 'anotheruser@anotherexample.com' });  }  ), 
    40      qr/To: anotheruser\@anotherexample.com/, 
    41      "Email sent");