diff --git a/t/basic.t b/t/basic.t index 45e9cef..cca39ec 100644 --- a/t/basic.t +++ b/t/basic.t @@ -11,7 +11,7 @@ $t->get_ok('/account')->status_is(302); $t->get_ok('/auth')->status_is(200)->content_like(qr/login/i); $t->post_ok('/login' => form => { logname => 'Dobby' }); $t->get_ok('/')->status_is(200)->content_like(qr/dobby/i); -$t->get_ok('/book/page/1')->status_is(200)->content_like(qr/book count/i); +$t->get_ok('/book/page/1')->status_is(200)->content_like(qr/[[:digit:]] books found/i); $t->get_ok('/logout')->status_is(302); # Can't do "content_unlike()" so check it offers login now. $t->get_ok('/')->status_is(200)->content_like(qr/login/i); diff --git a/templates/book/index.html.ep b/templates/book/index.html.ep index 560c67c..429b859 100644 --- a/templates/book/index.html.ep +++ b/templates/book/index.html.ep @@ -2,7 +2,8 @@ % title 'Books';

Book page

-%= form_for book_page => begin +<%# On a new search, reset the page number to 1. %> +%= form_for book_page => { page_number => 1 } => begin %= label_for title_like => 'Title like' %= text_field title_like => flash('title_like') %= submit_button "Search"