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