Skip to content

Commit

Permalink
Refill the form with the last address on lookup failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
rafl committed Feb 21, 2010
1 parent 4eb35fd commit 32ba7dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Metabase/ClaimID/Web/Templates/HTML.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package Metabase::ClaimID::Web::Templates::HTML;

use 5.010;
use Template::Declare::Tags;
use namespace::autoclean;

Expand Down Expand Up @@ -64,7 +65,7 @@ private template form => sub {
type => 'text',
name => 'email',
id => 'email',
value => 'Your Email Address',
value => $vars->{address} // 'Your Email Address',
};
};

Expand Down
1 change: 1 addition & 0 deletions t/web.t
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use Catalyst::Test 'Metabase::ClaimID::Web';
my $res = request(POST('/', [email => 'someone@nonexistanthost']));
ok(!$res->is_success, 'POST for nonexistant entry');
like($res->content, qr/no entry found/i, 'reports error');
like($res->content, qr/value="someone\@nonexistanthost"/, 'form has previous value again');
}

{
Expand Down

0 comments on commit 32ba7dc

Please sign in to comment.