-
-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
10 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,14 +22,10 @@ sub is_json { | |
} | ||
|
||
my $ctx = test_context(); | ||
|
||
Catalyst::Test->import('Hydra'); | ||
|
||
my $db = Hydra::Model::DB->new; | ||
hydra_setup($db); | ||
|
||
# Create a user to log in to | ||
my $user = $db->resultset('Users')->create({ username => 'alice', emailaddress => '[email protected]', password => '!' }); | ||
my $user = $ctx->db->resultset('Users')->create({ username => 'alice', emailaddress => '[email protected]', password => '!' }); | ||
$user->setPassword('foobar'); | ||
$user->userroles->update_or_create({ role => 'admin' }); | ||
|
||
|
@@ -128,7 +124,10 @@ subtest "/api/push" => sub { | |
my $jobsetName = $jobset->name; | ||
is($jobset->forceeval, undef, "The existing jobset is not set to be forced to eval"); | ||
|
||
my $response = request(POST "/api/push?jobsets=$projectName:$jobsetName&force=1", Cookie => $cookie); | ||
my $response = request(POST "/api/push?jobsets=$projectName:$jobsetName&force=1", | ||
Cookie => $cookie, | ||
Referer => 'http://localhost/', | ||
); | ||
ok($response->is_success, "The API enpdoint for triggering jobsets returns 200."); | ||
|
||
my $data = is_json($response); | ||
|
@@ -147,7 +146,10 @@ subtest "/api/push" => sub { | |
|
||
print STDERR $repo; | ||
|
||
my $response = request(POST "/api/push?repos=$repo&force=1", Cookie => $cookie); | ||
my $response = request(POST "/api/push?repos=$repo&force=1", | ||
Cookie => $cookie, | ||
Referer => 'http://localhost/', | ||
); | ||
ok($response->is_success, "The API enpdoint for triggering jobsets returns 200."); | ||
|
||
my $data = is_json($response); | ||
|