-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
1 parent
0ebbc6b
commit 8c66f8b
Showing
14 changed files
with
435 additions
and
63 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,6 @@ Install these: | |
* Docker Compose | ||
* jq | ||
* curl | ||
* ImageMagick | ||
* ffmpeg | ||
|
||
Then run this: | ||
|
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 |
---|---|---|
@@ -1,5 +1,26 @@ | ||
-- TODO: Delete | ||
CREATE INDEX IF NOT EXISTS idx__messaged__object_person_id__subject_person_id__created_at | ||
ON messaged(object_person_id, subject_person_id, created_at); | ||
-- TODO: Delete this and its associated test | ||
|
||
DROP INDEX IF EXISTS idx__messaged__object_person_id__subject_person_id; | ||
UPDATE | ||
person | ||
SET | ||
verification_level_id = | ||
CASE | ||
WHEN | ||
EXISTS ( | ||
SELECT | ||
1 | ||
FROM | ||
photo | ||
WHERE | ||
person_id = person.id | ||
AND | ||
verified | ||
) | ||
THEN | ||
3 | ||
|
||
ELSE | ||
2 | ||
END | ||
WHERE | ||
verification_level_id <> 1 |
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
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
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 |
---|---|---|
@@ -0,0 +1,102 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This test is mostly intended to verify that the `verificationjobrunner` runs | ||
# the jobs. The unit tests for the `verification` Python module are much | ||
# more in-depth. | ||
|
||
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" | ||
cd "$script_dir" | ||
|
||
source ../util/setup.sh | ||
|
||
set -xe | ||
|
||
q "delete from person" | ||
|
||
../util/create-user.sh user1 0 0 | ||
../util/create-user.sh user2 0 0 | ||
../util/create-user.sh user3 0 1 | ||
../util/create-user.sh user4 0 1 | ||
|
||
|
||
echo Set up user 1 | ||
q " | ||
update | ||
person | ||
set | ||
verified_age = false, | ||
verified_gender = false, | ||
verification_level_id = 1 | ||
where | ||
name = 'user1' | ||
" | ||
|
||
echo Set up user 2 | ||
q " | ||
update | ||
person | ||
set | ||
verified_age = true, | ||
verified_gender = true, | ||
verification_level_id = 2 | ||
where | ||
name = 'user2' | ||
" | ||
|
||
|
||
echo Set up user 3 | ||
q " | ||
update | ||
person | ||
set | ||
verified_age = true, | ||
verified_gender = true, | ||
verification_level_id = 2 | ||
where | ||
name = 'user3' | ||
" | ||
|
||
q " | ||
update | ||
photo | ||
set | ||
verified = true | ||
where | ||
person_id in (select id from person where name = 'user3') | ||
" | ||
|
||
echo Set up user 4 | ||
q " | ||
update | ||
person | ||
set | ||
verified_age = true, | ||
verified_gender = true, | ||
verification_level_id = 3 | ||
where | ||
name = 'user4' | ||
" | ||
|
||
q " | ||
update | ||
photo | ||
set | ||
verified = false | ||
where | ||
person_id in (select id from person where name = 'user4') | ||
" | ||
|
||
q "$(cat ../../migrations.sql)" | ||
|
||
verification_level_ids=$( | ||
q " | ||
select | ||
verification_level_id | ||
from | ||
person | ||
order by | ||
name | ||
" | xargs # Neatens whitespace | ||
) | ||
|
||
[[ "$verification_level_ids" = '1 2 3 2' ]] |
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
Oops, something went wrong.