diff options
author | Struan Donald <struan@exo.org.uk> | 2011-05-16 17:31:10 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-05-16 17:31:10 +0100 |
commit | 69e6532d4fa39441a1e78241336e2df60b432aa3 (patch) | |
tree | 3890a88e73a4c2b75a19c48c0fbd787162316745 /t/app/controller/report_display.t | |
parent | debac67821da719976f2d7805d21d9f0b8092a33 (diff) |
display/hide problem fixed checkbox
Diffstat (limited to 't/app/controller/report_display.t')
-rw-r--r-- | t/app/controller/report_display.t | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/t/app/controller/report_display.t b/t/app/controller/report_display.t index 6fadd6b9b..346722c64 100644 --- a/t/app/controller/report_display.t +++ b/t/app/controller/report_display.t @@ -106,6 +106,9 @@ subtest "test a good report" => sub { 'Reported by Test User at 15:47, Saturday 16 April 2011', 'correct problem meta information'; $mech->content_contains( 'Test 2 Detail' ); + + my $update_form = $mech->form_name( 'updateForm' ); + is $update_form->value( 'fixed' ), undef, 'problem is not fixed'; }; foreach my $meta ( @@ -175,6 +178,22 @@ foreach my $meta ( }; } +subtest "test a fixed report" => sub { + $report->state( 'fixed' ); + $report->update; + $mech->get_ok("/report/$report_id"); + is $mech->uri->path, "/report/$report_id", "at /report/$report_id"; + + my $update_form = $mech->form_name( 'updateForm' ); + my $banner = $mech->extract_problem_banner; + $banner->{text} =~ s/^ //g; + $banner->{text} =~ s/ $//g; + + is $banner->{id}, 'fixed', 'banner id'; + is $banner->{text}, 'This problem has been fixed.', 'banner text'; + is $update_form->find_input( 'fixed' ), undef, 'problem is fixed'; +}; + # tidy up $mech->delete_user('test@example.com'); done_testing(); |