Skip to content

Commit

Permalink
Correct URLs in the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
josegomezr committed Nov 14, 2023
1 parent a9f3e19 commit df8e801
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions t/ui/27-plugin_obs_rsync_obs_status.t
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ END { session->clean }

my $port = Mojo::IOLoop::Server->generate_port;
my $host = "http://127.0.0.1:$port";
my $url = "$host/public/build/%%PROJECT/_result";
my $url = "$host/build/%%PROJECT/_result";
my %fake_response_by_project = (
Proj3 => '
<!-- This project is published. -->
Expand Down Expand Up @@ -95,7 +95,7 @@ my $server_instance = process sub {
my $mock = Mojolicious->new;
$mock->mode('test');
$mock->routes->get(
'/public/build/ProjWithAuth/_result' => sub {
'/build/ProjWithAuth/_result' => sub {
my $c = shift;

if ($c->req->headers->authorization) {
Expand All @@ -107,7 +107,7 @@ my $server_instance = process sub {
});

$mock->routes->get(
'/public/build/ProjTestingSignature/_result' => sub {
'/build/ProjTestingSignature/_result' => sub {
my $c = shift;

if ($c->req->headers->authorization && $auth_header_exact eq $c->req->headers->authorization) {
Expand All @@ -120,7 +120,7 @@ my $server_instance = process sub {

for my $project (sort keys %fake_response_by_project) {
$mock->routes->get(
"/public/build/$project/_result" => sub {
"/build/$project/_result" => sub {
my $c = shift;
my $pkg = $c->param('package');
return $c->render(status => 404) if !$pkg and $project ne 'Proj1';
Expand Down Expand Up @@ -171,9 +171,9 @@ subtest 'test api package helper' => sub {
};

subtest 'test api url helper' => sub {
is($helper->get_api_dirty_status_url('Proj1'), "$host/public/build/Proj1/_result");
is($helper->get_api_dirty_status_url('Proj2'), "$host/public/build/Proj2/_result?package=0product");
is($helper->get_api_dirty_status_url('BatchedProj'), "$host/public/build/BatchedProj/_result?package=000product");
is($helper->get_api_dirty_status_url('Proj1'), "$host/build/Proj1/_result");
is($helper->get_api_dirty_status_url('Proj2'), "$host/build/Proj2/_result?package=0product");
is($helper->get_api_dirty_status_url('BatchedProj'), "$host/build/BatchedProj/_result?package=000product");
};

subtest 'test builds_text helper' => sub {
Expand Down

0 comments on commit df8e801

Please sign in to comment.