Hello Dancer Users, I have a question about Dancer::Test. I use `response_status_is` to test routing and execution in my application. I can do that successfully 'plain' paths, e.g.: response_status_is ['GET', '/rest/resource'], 200; But this method fails if i want to use query parameters in the URL, e.g.: response_status_is ['GET', '/rest/resource?query=something'], 200; In the latter case, Dancer::Test fails (the whole testcase btw) t/003_some_tests.t .... 1/? Can't call method "status" on an undefined value at /usr/local/share/perl/5.10.1/Dancer/Test.pm line 111. # Tests were run but no plan was declared and done_testing() was not seen. t/003_acs_tests.t .... Dubious, test returned 255 (wstat 65280, 0xff00) Anything I could do about this? Any help appreciated! -- Rudolf Muehlbauer <rudolf.muehlbauer@gmail.com>
On 04/03/2011 20:41, Rudolf Muehlbauer wrote:
t/003_some_tests.t .... 1/? Can't call method "status" on an undefined value at /usr/local/share/perl/5.10.1/Dancer/Test.pm line 111. # Tests were run but no plan was declared and done_testing() was not seen. t/003_acs_tests.t .... Dubious, test returned 255 (wstat 65280, 0xff00)
Anything I could do about this? Any help appreciated!
Use dancer_response instead, you'll be able to pass parameters: my $response = dancer_response GET => '/path', { params => { foo => 42 } }; -- Alexis Sukrieh
On Sat, Mar 5, 2011 at 6:25 AM, Alexis Sukrieh <sukria@sukria.net> wrote:
On 04/03/2011 20:41, Rudolf Muehlbauer wrote:
t/003_some_tests.t .... 1/? Can't call method "status" on an undefined value at /usr/local/share/perl/5.10.1/Dancer/Test.pm line 111. # Tests were run but no plan was declared and done_testing() was not seen. t/003_acs_tests.t .... Dubious, test returned 255 (wstat 65280, 0xff00)
Anything I could do about this? Any help appreciated!
Use dancer_response instead, you'll be able to pass parameters:
my $response = dancer_response GET => '/path', { params => { foo => 42 } };
You can also call response_status_is in this way: response_status_is ['GET', '/path', { params => { foo => 42 } }], 200; This way is not documented yet. -Naveed
-- Alexis Sukrieh _______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
participants (3)
-
Alexis Sukrieh -
Naveed Massjouni -
Rudolf Muehlbauer