Skip to content

Commit c35c595

Browse files
committed
test that emojis are supported everywhere we insert/modify character data in the db
1 parent 7edfdbf commit c35c595

9 files changed

+65
-65
lines changed

app/api/answers/create_answer.feature

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Feature: Create a 'saved' answer
3333
When I send a POST request to "/items/50/attempts/1/answers" with the following body:
3434
"""
3535
{
36-
"answer": "print 1",
36+
"answer": "print 1 # 🐱",
3737
"state": "some state"
3838
}
3939
"""
@@ -46,9 +46,9 @@ Feature: Create a 'saved' answer
4646
}
4747
"""
4848
And the table "answers" should be:
49-
| author_id | attempt_id | participant_id | item_id | type | answer | state | ABS(TIMESTAMPDIFF(SECOND, created_at, NOW())) < 3 |
50-
| 101 | 1 | 101 | 50 | Submission | null | null | 0 |
51-
| 101 | 1 | 101 | 50 | Saved | print 1 | some state | 1 |
49+
| author_id | attempt_id | participant_id | item_id | type | answer | state | ABS(TIMESTAMPDIFF(SECOND, created_at, NOW())) < 3 |
50+
| 101 | 1 | 101 | 50 | Submission | null | null | 0 |
51+
| 101 | 1 | 101 | 50 | Saved | print 1 # 🐱 | some state | 1 |
5252

5353
Scenario: User is able to save an answer as a team
5454
Given I am the user with id "101"

app/api/answers/submit.feature

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Feature: Submit a new answer
4646
"""
4747
{
4848
"task_token": "{{userTaskToken}}",
49-
"answer": "print 1"
49+
"answer": "print 1 # 🐱"
5050
}
5151
"""
5252
Then the response code should be 201
@@ -65,7 +65,7 @@ Feature: Submit a new answer
6565
"randomSeed": "",
6666
"sHintsRequested": "[{\"rotorIndex\":0,\"cellRank\":0}]",
6767
"nbHintsGiven": "12",
68-
"sAnswer": "print 1",
68+
"sAnswer": "print 1 # 🐱",
6969
"idUserAnswer": "5577006791947779410"
7070
}
7171
},
@@ -78,8 +78,8 @@ Feature: Submit a new answer
7878
user_id=101
7979
"""
8080
And the table "answers" should be:
81-
| author_id | participant_id | attempt_id | item_id | type | answer | ABS(TIMESTAMPDIFF(SECOND, created_at, NOW())) < 3 |
82-
| 101 | 101 | 1 | 50 | Submission | print 1 | 1 |
81+
| author_id | participant_id | attempt_id | item_id | type | answer | ABS(TIMESTAMPDIFF(SECOND, created_at, NOW())) < 3 |
82+
| 101 | 101 | 1 | 50 | Submission | print 1 # 🐱 | 1 |
8383
And the table "results" should be:
8484
| attempt_id | participant_id | item_id | hints_requested | hints_cached | submissions | ABS(TIMESTAMPDIFF(SECOND, latest_activity_at, NOW())) < 3 | ABS(TIMESTAMPDIFF(SECOND, latest_submission_at, NOW())) < 3 |
8585
| 1 | 101 | 10 | null | 0 | 0 | 1 | null |

app/api/answers/update_current.feature

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Feature: Update the 'current' answer
3333
When I send a PUT request to "/items/50/attempts/1/answers/current" with the following body:
3434
"""
3535
{
36-
"answer": "print 1",
36+
"answer": "print 1 # 🐱",
3737
"state": "some state"
3838
}
3939
"""
@@ -46,9 +46,9 @@ Feature: Update the 'current' answer
4646
}
4747
"""
4848
And the table "answers" should be:
49-
| author_id | participant_id | attempt_id | item_id | type | answer | state | ABS(TIMESTAMPDIFF(SECOND, created_at, NOW())) < 3 |
50-
| 101 | 101 | 1 | 50 | Submission | null | null | 0 |
51-
| 101 | 101 | 1 | 50 | Current | print 1 | some state | 1 |
49+
| author_id | participant_id | attempt_id | item_id | type | answer | state | ABS(TIMESTAMPDIFF(SECOND, created_at, NOW())) < 3 |
50+
| 101 | 101 | 1 | 50 | Submission | null | null | 0 |
51+
| 101 | 101 | 1 | 50 | Current | print 1 # 🐱 | some state | 1 |
5252

5353
Scenario: User is able to create the 'current' answer for a team attempt
5454
Given I am the user with id "101"

app/api/auth/create_access_token.feature

+15-15
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ Feature: Create an access token
3838
"""
3939
{
4040
"id":100000001, "login":"mohammed","login_updated_at":"2019-07-16 01:56:25","login_fixed":0,
41-
"login_revalidate_required":0,"login_change_required":0,"language":"en","first_name":"Mohammed",
42-
"last_name":"Amrani","real_name_visible":true,"timezone":"Africa\/Algiers","country_code":"DZ",
41+
"login_revalidate_required":0,"login_change_required":0,"language":"en","first_name":"Mohammed 🐱",
42+
"last_name":"Amrani 🐱","real_name_visible":true,"timezone":"Africa\/Algiers","country_code":"DZ",
4343
"address":null,"city":null,"zipcode":null,"primary_phone":null,"secondary_phone":null,
4444
"role":"student","school_grade":null,"student_id":"123456789","ministry_of_education":null,
45-
"ministry_of_education_fr":false,"birthday":"2000-07-02","presentation":"I'm Mohammed Amrani",
45+
"ministry_of_education_fr":false,"birthday":"2000-07-02","presentation":"I'm Mohammed Amrani 🐱",
4646
"website":"http://mohammed.freepages.com","ip":"127.0.0.1","picture":"http:\/\/127.0.0.1:8000\/images\/user.png",
4747
"gender":"m","graduation_year":2020,"graduation_grade_expire_at":"2020-07-01 00:00:00",
4848
"graduation_grade":0,"created_at":"2019-07-16 01:56:25","last_login":"2019-07-22 14:47:18",
@@ -59,10 +59,10 @@ Feature: Create an access token
5959
"data": {"category": "", "round": null},
6060
"manager": false,
6161
"badge_info": {
62-
"name": "Example #1",
62+
"name": "Example #1 🐱",
6363
"group_path": [
64-
{"url": "https:\/\/badges.example.com\/", "name": "Example badges", "manager": true},
65-
{"url": "https:\/\/badges.example.com\/parents", "name": "Example badges with multiple parents", "manager": false}
64+
{"url": "https:\/\/badges.example.com\/", "name": "Example badges 🐱", "manager": true},
65+
{"url": "https:\/\/badges.example.com\/parents", "name": "Example badges with multiple parents 🐱", "manager": false}
6666
]
6767
},
6868
"last_update": "2022-07-18T16:07:12+0000"
@@ -85,16 +85,16 @@ Feature: Create an access token
8585
"""
8686
And the response header "Set-Cookie" should be "<expected_cookie>"
8787
And the table "users" should be:
88-
| group_id | latest_login_at | latest_activity_at | temp_user | registered_at | latest_profile_sync_at | login_id | login | email | first_name | last_name | student_id | country_code | birth_date | graduation_year | grade | address | zipcode | city | land_line_number | cell_phone_number | default_language | free_text | web_site | sex | email_verified | last_ip | time_zone | notify_news | photo_autoload | public_first_name | public_last_name |
89-
| 5577006791947779410 | 2019-07-16 22:02:28 | 2019-07-16 22:02:28 | 0 | 2019-07-16 22:02:28 | 2019-07-16 22:02:28 | 100000001 | mohammed | mohammedam@gmail.com | Mohammed | Amrani | 123456789 | dz | 2000-07-02 | 2020 | 0 | null | null | null | null | null | en | I'm Mohammed Amrani | http://mohammed.freepages.com | Male | 0 | 127.0.0.1 | Africa/Algiers | true | true | true | true |
88+
| group_id | latest_login_at | latest_activity_at | temp_user | registered_at | latest_profile_sync_at | login_id | login | email | first_name | last_name | student_id | country_code | birth_date | graduation_year | grade | address | zipcode | city | land_line_number | cell_phone_number | default_language | free_text | web_site | sex | email_verified | last_ip | time_zone | notify_news | photo_autoload | public_first_name | public_last_name |
89+
| 5577006791947779410 | 2019-07-16 22:02:28 | 2019-07-16 22:02:28 | 0 | 2019-07-16 22:02:28 | 2019-07-16 22:02:28 | 100000001 | mohammed | mohammedam@gmail.com | Mohammed 🐱 | Amrani 🐱 | 123456789 | dz | 2000-07-02 | 2020 | 0 | null | null | null | null | null | en | I'm Mohammed Amrani 🐱 | http://mohammed.freepages.com | Male | 0 | 127.0.0.1 | Africa/Algiers | true | true | true | true |
9090
And the table "groups" should be:
91-
| id | name | type | description | ABS(TIMESTAMPDIFF(SECOND, NOW(), created_at)) < 3 | is_open | send_emails | text_id |
92-
| 2 | AllUsers | Base | null | false | false | false | null |
93-
| 4 | TempUsers | Base | null | false | false | false | null |
94-
| 4037200794235010051 | Example badges | Other | null | true | false | false | https://badges.example.com/ |
95-
| 5577006791947779410 | mohammed | User | mohammed | true | false | false | null |
96-
| 6129484611666145821 | Example badges with multiple parents | Other | null | true | false | false | https://badges.example.com/parents |
97-
| 8674665223082153551 | Example #1 | Other | null | true | false | false | https://badges.example.com/examples/one |
91+
| id | name | type | description | ABS(TIMESTAMPDIFF(SECOND, NOW(), created_at)) < 3 | is_open | send_emails | text_id |
92+
| 2 | AllUsers | Base | null | false | false | false | null |
93+
| 4 | TempUsers | Base | null | false | false | false | null |
94+
| 4037200794235010051 | Example badges 🐱 | Other | null | true | false | false | https://badges.example.com/ |
95+
| 5577006791947779410 | mohammed | User | mohammed | true | false | false | null |
96+
| 6129484611666145821 | Example badges with multiple parents 🐱 | Other | null | true | false | false | https://badges.example.com/parents |
97+
| 8674665223082153551 | Example #1 🐱 | Other | null | true | false | false | https://badges.example.com/examples/one |
9898
And the table "groups_groups" should be:
9999
| parent_group_id | child_group_id |
100100
| 2 | 4 |

0 commit comments

Comments
 (0)