forked from lix-project/hydra
test /job/PROJECT/JOBSET/JOB/shield works
Uses buildListColumns
This commit is contained in:
parent
97596c3e93
commit
b37ca88fd5
|
@ -4,6 +4,7 @@ use Setup;
|
||||||
use Test2::V0;
|
use Test2::V0;
|
||||||
use Catalyst::Test ();
|
use Catalyst::Test ();
|
||||||
use HTTP::Request::Common;
|
use HTTP::Request::Common;
|
||||||
|
use JSON::MaybeXS qw(decode_json);
|
||||||
|
|
||||||
my $ctx = test_context();
|
my $ctx = test_context();
|
||||||
|
|
||||||
|
@ -28,4 +29,22 @@ subtest "/job/PROJECT/JOBSET/JOB/channel/latest" => sub {
|
||||||
ok($response->is_success, "The page showing the job's channel returns 200.");
|
ok($response->is_success, "The page showing the job's channel returns 200.");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
subtest "/job/PROJECT/JOBSET/JOB/shield" => sub {
|
||||||
|
my $response = request(GET '/job/' . $project->name . '/' . $jobset->name . '/' . $build->job . '/shield');
|
||||||
|
ok($response->is_success, "The page showing the job's shield returns 200.");
|
||||||
|
|
||||||
|
my $data;
|
||||||
|
my $valid_json = lives { $data = decode_json($response->content); };
|
||||||
|
ok($valid_json, "We get back valid JSON.");
|
||||||
|
if (!$valid_json) {
|
||||||
|
use Data::Dumper;
|
||||||
|
print STDERR Dumper $response->content;
|
||||||
|
}
|
||||||
|
|
||||||
|
is($data->{"color"}, "green");
|
||||||
|
is($data->{"label"}, "hydra build");
|
||||||
|
is($data->{"message"}, "passing");
|
||||||
|
is($data->{"schemaVersion"}, 1);
|
||||||
|
};
|
||||||
|
|
||||||
done_testing;
|
done_testing;
|
||||||
|
|
Loading…
Reference in a new issue