Commit graph

21 commits

Author SHA1 Message Date
smavros
2c087e80e7 Adds test for invalid user update 2019-08-25 20:55:44 +02:00
smavros
4d79f06aba Renaming - Uses only one modRequest variable in user test 2019-08-25 20:02:35 +02:00
smavros
5c820982e4 Adds test for user who modifies his credentials 2019-08-25 19:58:56 +02:00
smavros
c00d0e0422 Uses GetResponseID() instead of LengthOfResponse() in user test 2019-08-25 17:05:00 +02:00
smavros
e0746f112f Minor changes in modify user test 2019-08-23 13:05:31 +02:00
smavros
0e0936a736 Adds test for user endpoint:
- For getting all the users
    - For modifying a user as Admin
    - For adding a user
2019-08-19 11:44:08 +02:00
smavros
94ea3c4ebf Breaks user test into different testing functions 2019-08-15 18:16:30 +02:00
smavros
c2429394ed Renames VisitorAuthenticate() to RegisterAuthenticate() 2019-08-15 14:52:19 +02:00
smavros
426b834ea5 Modifies tests for accepting {"id":$userID} response 2019-08-15 14:37:13 +02:00
smavros
1e4a2ee7cb Adds test for PUT /user/$ID endpoint 2019-08-15 00:36:46 +02:00
smavros
86870e3075 Adds test for POST /user 2019-08-13 19:30:21 +02:00
smavros
59a37bf601 Removes Credentials type from common/models.go:
Every test will fail except from the user's package since it is the
    only one using the new Request type.
2019-08-13 19:21:39 +02:00
smavros
b6a269bdeb Deprecates ResponseMsgUses. Introduces common/requests.go 2019-08-13 17:41:04 +02:00
smavros
ae2737571f Adds test for GET /user/:ID 2019-08-13 16:56:10 +02:00
smavros
6aee1a7aca Improves NewAuthenticateForTest():
- As NewTestEndpoint() the credentials are passed as interface{} and
    marsaling is happening inside the function.
    - Add check for ignored error from http.NewRequest()
2019-08-11 20:03:23 +02:00
smavros
41bb54e933 Modifies NewTestEndpoint() and user_test:
Instead of marshaling the expected response in the test function the
    marshaling happens inside the NewTestEndpoint() where is passed as
    interface{}.
2019-08-11 19:41:48 +02:00
smavros
dbd8d7ddeb Adds DummyOnlyAdminDB() for testing with empty DB 2019-08-11 18:10:33 +02:00
smavros
8e185ecba4 Adds NewAuthenticateForTest() in common/utilities.go:
- The function must return the token and an error (string, error).
    In case of an error the token is going to be an empty string. The
    assertion for the error __must__ be executed in the body of the
    test. The utility functions __must not__ panic. All of the tests
    must use this function in the future.
2019-08-04 20:08:27 +02:00
smavros
e2430cadef Changes testing function in \users test file 2019-08-04 19:54:09 +02:00
smavros
cf69e59a5f Modifies testdata setup:
- Decorates User model with json tags for marshaling.
    - Introduces Model type same as gorm.Model with additional json tags
    for marshaling.
    - Modifies ResponseMsgUsers type.
    - Modifies the testdata for the users by including initializer for
    the Mode.ID field.
    - The scenario test fails for those changes
2019-07-30 20:31:59 +02:00
smavros
a283d32dff Adds first users endpoint test 2019-07-30 18:03:20 +02:00