Reset to page 1 on a new search. Fix test.
This commit is contained in:
parent
e253331a5e
commit
94b888f0f5
|
@ -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);
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
% title 'Books';
|
||||
<h1>Book page</h1>
|
||||
|
||||
%= 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"
|
||||
|
|
Loading…
Reference in New Issue