-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from moosetechnology/fix-email-importer
fix/add email user to the importer + tests
- Loading branch information
Showing
4 changed files
with
102 additions
and
9 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
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,7 +1,7 @@ | ||
Class { | ||
#name : #GLHApiMock, | ||
#superclass : #GLHApi, | ||
#category : 'GitLabHealth-Model-Importer-Tests' | ||
#category : #'GitLabHealth-Model-Importer-Tests' | ||
} | ||
|
||
{ #category : #'api - commits' } | ||
|
@@ -10,3 +10,65 @@ GLHApiMock >> commitDiff: aCommitID ofProject: aProjectId unidiff: aBoolean [ | |
aCommitID = 'createError' ifTrue: [ | ||
^ '{"message":"500 Internal Server Error"}' ] | ||
] | ||
|
||
{ #category : #api } | ||
GLHApiMock >> user: aUserID [ | ||
|
||
^ '{ | ||
"id": 123, | ||
"username": "jack.dupond", | ||
"name": "dupond jack", | ||
"state": "active", | ||
"locked": false, | ||
"avatar_url": "https://gitlab.myCompany.com/uploads/-/system/user/avatar/123/avatar.png", | ||
"web_url": "https://gitlab.myCompany.com/Jack.Dupond", | ||
"created_at": "2021-06-19T21:11:06.114+02:00", | ||
"bio": "I am a very good developer. All my life I try to be as good as Badetitou", | ||
"location": "", | ||
"public_email": "[email protected]", | ||
"skype": "", | ||
"linkedin": "", | ||
"twitter": "", | ||
"discord": "", | ||
"website_url": "", | ||
"organization": "", | ||
"job_title": "", | ||
"pronouns": "", | ||
"bot": false, | ||
"work_information": null, | ||
"followers": 0, | ||
"following": 0, | ||
"is_followed": false, | ||
"local_time": "3:05 PM", | ||
"last_sign_in_at": "2024-10-31T09:16:46.412+01:00", | ||
"confirmed_at": "2021-06-19T21:11:05.919+02:00", | ||
"last_activity_on": "2024-11-04", | ||
"email": "[email protected]", | ||
"theme_id": 8, | ||
"color_scheme_id": 1, | ||
"projects_limit": 0, | ||
"current_sign_in_at": "2024-11-04T09:06:50.149+01:00", | ||
"identities": [ | ||
{ | ||
"provider": "azure_activedirectory_v2", | ||
"extern_uid": "3de29e50-1847-11ccd28ddc23e22a" | ||
} | ||
], | ||
"can_create_group": false, | ||
"can_create_project": false, | ||
"two_factor_enabled": false, | ||
"external": false, | ||
"private_profile": false, | ||
"commit_email": "[email protected]", | ||
"is_admin": false, | ||
"note": null, | ||
"namespace_id": 1234, | ||
"created_by": null, | ||
"email_reset_offered_at": null, | ||
"highest_role": 50, | ||
"current_sign_in_ip": "10.12.0.12", | ||
"last_sign_in_ip": "10.12.0.12", | ||
"sign_in_count": 12345 | ||
} | ||
' | ||
] |
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 |
---|---|---|
|
@@ -8,7 +8,7 @@ Class { | |
'importer', | ||
'model' | ||
], | ||
#category : 'GitLabHealth-Model-Importer-Tests' | ||
#category : #'GitLabHealth-Model-Importer-Tests' | ||
} | ||
|
||
{ #category : #running } | ||
|
@@ -53,3 +53,15 @@ GLHModelImporterLocalTest >> testIsServerError [ | |
self assert: | ||
(importer isServerError: '{"message":"500 Internal Server Error"}') | ||
] | ||
|
||
{ #category : #tests } | ||
GLHModelImporterLocalTest >> testParseUserResult [ | ||
|
||
| user | | ||
user := importer importUser: 123. | ||
self assert: user id equals: 123. | ||
|
||
self assert: user name equals: 'dupond jack'. | ||
self assert: user email equals: '[email protected]'. | ||
self assert: user public_email equals: '[email protected]'. | ||
] |