Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Korko
SecretSanta.fr
Commits
d8ec6029
Verified
Commit
d8ec6029
authored
Apr 15, 2020
by
Korko
Browse files
Fix tests
parent
2ec71167
Pipeline
#290665
failed with stage
in 1 minute and 15 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
routes/web.php
View file @
d8ec6029
...
@@ -18,7 +18,7 @@ Route::post('/', 'RandomFormController@handle'); //->middleware('decrypt.input')
...
@@ -18,7 +18,7 @@ Route::post('/', 'RandomFormController@handle'); //->middleware('decrypt.input')
Route
::
get
(
'/faq'
,
'RandomFormController@faq'
)
->
name
(
'faq'
);
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
::
get
(
'/dearsanta/{santa}'
,
'DearSantaController@view'
)
->
name
(
'dearsanta'
);
Route
::
middleware
([
'decrypt.key'
])
->
group
(
function
()
{
Route
::
middleware
([
'decrypt.key'
])
->
group
(
function
()
{
...
@@ -27,7 +27,7 @@ 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
::
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
::
get
(
'/org/{draw}'
,
'OrganizerController@view'
)
->
name
(
'organizerPanel'
);
Route
::
middleware
([
'decrypt.key'
])
->
group
(
function
()
{
Route
::
middleware
([
'decrypt.key'
])
->
group
(
function
()
{
...
...
tests/Feature/RequestOrganizerTest.php
View file @
d8ec6029
...
@@ -36,7 +36,7 @@ class RequestOrganizerTest extends RequestCase
...
@@ -36,7 +36,7 @@ class RequestOrganizerTest extends RequestCase
// Check data can be changed
// Check data can be changed
$path
=
route
(
'organizerPanel.resendEmail'
,
[
$path
=
route
(
'organizerPanel.resendEmail'
,
[
'draw'
=>
$draw
->
id
,
'draw'
=>
$draw
->
hash
,
'participant'
=>
$participant
,
'participant'
=>
$participant
,
]);
]);
$response
=
$this
->
ajaxPost
(
$path
,
[
$response
=
$this
->
ajaxPost
(
$path
,
[
...
@@ -61,7 +61,7 @@ class RequestOrganizerTest extends RequestCase
...
@@ -61,7 +61,7 @@ class RequestOrganizerTest extends RequestCase
// Check data can be changed
// Check data can be changed
$path
=
route
(
'organizerPanel.changeEmail'
,
[
$path
=
route
(
'organizerPanel.changeEmail'
,
[
'draw'
=>
$draw
->
id
,
'draw'
=>
$draw
->
hash
,
'participant'
=>
$participant
,
'participant'
=>
$participant
,
]);
]);
$response
=
$this
->
ajaxPost
(
$path
,
[
$response
=
$this
->
ajaxPost
(
$path
,
[
...
...
tests/Unit/DrawHandlerTest.php
View file @
d8ec6029
...
@@ -99,9 +99,9 @@ class DrawHandlerTest extends TestCase
...
@@ -99,9 +99,9 @@ class DrawHandlerTest extends TestCase
// Check data stored are decryptable
// Check data stored are decryptable
$path
=
parse_url
(
$link
,
PHP_URL_PATH
);
$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
);
$data
=
sscanf
(
$path
,
$pathTheorical
);
$draw
=
Draw
::
find
(
$data
[
0
]);
$draw
=
Draw
::
find
ByHashOrFail
(
$data
[
0
]);
$this
->
assertNotEquals
(
0
,
$draw
->
participants
->
count
());
$this
->
assertNotEquals
(
0
,
$draw
->
participants
->
count
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment