211
|
1 package Test::Web::AutoLocator;
|
|
2 use strict;
|
|
3
|
|
4 use IMPL::Test qw(test assert);
|
|
5 use URI();
|
|
6
|
|
7 use IMPL::declare {
|
|
8 require => {
|
|
9 'Locator' => 'IMPL::Web::AutoLocator'
|
|
10 },
|
|
11 base => {
|
|
12 'IMPL::Test::Unit' => '@_'
|
|
13 }
|
|
14 };
|
|
15
|
|
16 test TestCreation => sub {
|
|
17 my $location = Locator->new(base => 'http://bugs.company.org', view => "cgi");
|
|
18
|
|
19 my $url = $location->show_bug({id => 100});
|
|
20 assert( $url->url eq "http://bugs.company.org/show_bug.cgi?id=100", $url->url );
|
|
21
|
|
22 $url = $location->SetView(undef)->help->CreateBug->HowTo;
|
|
23 assert( $url->url eq "http://bugs.company.org/help/CreateBug/HowTo", $url->url );
|
|
24 };
|
|
25
|
|
26 1; |