Verified Commit d8ec6029 authored by Korko's avatar Korko
Browse files

Fix tests

parent 2ec71167
Pipeline #290665 failed with stage
in 1 minute and 15 seconds
......@@ -18,7 +18,7 @@ Route::post('/', 'RandomFormController@handle'); //->middleware('decrypt.input')
Route::get('/faq', 'RandomFormController@faq')->name('faq');
Route::pattern('santa', '[0-9a-zA-Z]{'.config('hashids.connections')['santa']['length'].'}');
Route::pattern('santa', '[0-9a-zA-Z]{'.config('hashids.connections.santa.length').'}');
Route::get('/dearsanta/{santa}', 'DearSantaController@view')->name('dearsanta');
Route::middleware(['decrypt.key'])->group(function () {
......@@ -27,7 +27,7 @@ Route::middleware(['decrypt.key'])->group(function () {
});
Route::post('/dearsanta/{santa}/fetchState', 'DearSantaController@fetchState')->name('dearsanta.fetchState');
Route::pattern('draw', '[0-9a-zA-Z]{'.config('hashids.connections')['draw']['length'].'}');
Route::pattern('draw', '[0-9a-zA-Z]{'.config('hashids.connections.draw.length').'}');
Route::get('/org/{draw}', 'OrganizerController@view')->name('organizerPanel');
Route::middleware(['decrypt.key'])->group(function () {
......
......@@ -36,7 +36,7 @@ class RequestOrganizerTest extends RequestCase
// Check data can be changed
$path = route('organizerPanel.resendEmail', [
'draw' => $draw->id,
'draw' => $draw->hash,
'participant' => $participant,
]);
$response = $this->ajaxPost($path, [
......@@ -61,7 +61,7 @@ class RequestOrganizerTest extends RequestCase
// Check data can be changed
$path = route('organizerPanel.changeEmail', [
'draw' => $draw->id,
'draw' => $draw->hash,
'participant' => $participant,
]);
$response = $this->ajaxPost($path, [
......
......@@ -99,9 +99,9 @@ class DrawHandlerTest extends TestCase
// Check data stored are decryptable
$path = parse_url($link, PHP_URL_PATH);
$pathTheorical = parse_url(route('organizerPanel', ['draw' => '%d']), PHP_URL_PATH);
$pathTheorical = parse_url(route('organizerPanel', ['draw' => '%s']), PHP_URL_PATH);
$data = sscanf($path, $pathTheorical);
$draw = Draw::find($data[0]);
$draw = Draw::findByHashOrFail($data[0]);
$this->assertNotEquals(0, $draw->participants->count());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment