Permalink
Browse files

add some more tests and some more names to forms

  • Loading branch information...
1 parent ac7b702 commit 2e2ef01cba047f3d7c8596bda906584094a47d83 @szabgab committed Feb 28, 2010
Showing with 27 additions and 7 deletions.
  1. +1 −0 lib/CPAN/Forum.pm
  2. +23 −0 t/mech/100-auth.t
  3. +1 −2 tt/pages/module_search_form.tt
  4. +1 −2 tt/pages/module_select_form.tt
  5. +1 −3 tt/pages/users.tt
View
@@ -498,6 +498,7 @@ my @urls = qw(
reset_password_form_process
reset_password_request
reset_password_request_process
+ module_search
);
View
@@ -624,6 +624,29 @@ foreach my $i ( 0 .. 2 ) {
BEGIN { $tests += 2 }
}
+{
+ diag("Start posting on the main page");
+
+ $w_user->get_ok($url);
+ $w_user->follow_link_ok( { text => 'New Post' } );
+ $w_user->content_like(qr{Please search for the name of a module});
+ my $module_search_form = $w_user->form_name('module_search');
+ $w_user->submit_form(
+ form_name => 'module_search',
+ fields => {
+ q => 'Acme',
+ },
+ );
+ my $module_select_form = $w_user->form_name('module_select');
+
+ # TODO check which modules are listed, select one of them
+
+ # TODO test with 'acme' and then allow for that too to match
+
+ BEGIN { $tests += 3 }
+}
+
+
#{
# diag('reset password');
# my $w_user2 = t::lib::CPAN::Forum::Test::get_mech();
@@ -15,9 +15,8 @@
Please search for the name of a module.
</p>
-<form method="post" action="/module_search/">
+<form method="post" action="/module_search/" name="module_search">
<p>
-<input type="hidden" name="rm" value="module_search" />
<input name="q" value="[% q %]" />
<input type="submit" value="Search" />
</p>
@@ -11,9 +11,8 @@
[% IF invalid_search_term %]Invalid or missing search term[% END %]
</p>
-<form method="post" action="/new_post/">
+<form method="post" name="module_select" action="/new_post/">
<p>
-<input type="hidden" name="rm" value="new_post" />
[% group_selector %]
<input type="submit" value="Select" />
</p>
View
@@ -24,10 +24,8 @@ Tags by <a href="/tags/user/[% this_username %]">[% this_username %]</a>
</div>
[% INCLUDE incl/listing.tt %]
-</div>
+</div>
[% INCLUDE incl/right_side.tt %]
-
</div>
-
[% INCLUDE incl/footer.tt %]

0 comments on commit 2e2ef01

Please sign in to comment.