1. Shlomi Fish
  2. perl-Test-WWW-Mechanize-Mojo

Commits

shl...@52c325ad-5fd0-0310-8a0f-c43feede02cc  committed f89aba2

Now using ->path_query instead of ->path to get the HTTP GET params.

  • Participants
  • Parent commits 936f87c
  • Branches default
  • Tags releases/0.0.4

Comments (0)

Files changed (5)

File Test-WWW-Mechanize-Mojo/CHANGES

View file
 Revision history for Perl module Test::WWW::Mechanize::Mojo :
 
+v0.0.4      Wed Mar 17 16:01:20 IST 2010
+    - Now evaluating the GET parameters in requests by using URI.pm's
+    ->path_query() instead of ->path().
+
 v0.0.3      Thu Mar  4 00:35:10 IST 2010
     - Fix submit_form_ok on the contemporary Mojo::Client . (with a test).
 

File Test-WWW-Mechanize-Mojo/META.yml

View file
 provides:
   Test::WWW::Mechanize::Mojo:
     file: lib/Test/WWW/Mechanize/Mojo.pm
-    version: v0.0.3
+    version: v0.0.4
 requires:
   Carp: 0
   Encode: 0
   homepage: http://web-cpan.berlios.de/modules/Test-WWW-Mechanize-Mojo/
   license: http://dev.perl.org/licenses/
   repository: http://svn.berlios.de/svnroot/repos/web-cpan/Test-WWW-Mechanize-Mojo
-version: v0.0.3
+version: v0.0.4

File Test-WWW-Mechanize-Mojo/lib/Test/WWW/Mechanize/Mojo.pm

View file
 
 use Test::Mojo;
 
-our $VERSION = '0.0.3';
+our $VERSION = '0.0.4';
 
 our $APP_CLASS;
 my $Test = Test::Builder->new();
         $request->header_field_names()
     );
 
-    $client->$method($uri->path(), 
+    $client->$method($uri->path_query(), 
         # TODO : fix this to pass it as a ref.
         %headers,
         $request->content,

File Test-WWW-Mechanize-Mojo/t/lib/mojjy.pl

View file
     return;
 };
 
+get '/with-params' => sub {
+    my $self = shift;
+
+    $self->render_text(sprintf("[%s]{%s}", $self->param('one'), $self->param('two')));
+};
+
 get '/:groovy' => sub {
     my $self = shift;
     $self->render_text($self->param('groovy'), layout => 'funky');

File Test-WWW-Mechanize-Mojo/t/simple.t

View file
 use strict;
 use warnings;
 
-use Test::More tests => 21;
+use Test::More tests => 25;
 
 use Test::Mojo;
 use Test::WWW::Mechanize::Mojo;
 # TEST
 $m->content_contains( $chars, qq{content contains "$bytes"});
 
+# TEST
+$m->get_ok('/with-params?one=foo&two=bar');
+# TEST
+$m->content_contains("[foo]{bar}", "Get params are OK.");
+
+# TEST
+$m->get_ok('/with-params?one=sophie&two=jack');
+# TEST
+$m->content_contains("[sophie]{jack}", "Get params (#2) are OK.");
+
 =begin remmed_out
 
 SKIP: {