-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write Test For CreateOrEditFeatures #1819
Labels
Comments
@elraphty Can I take this one or the next one as I have completed my previous task? |
@elraphty Please assign me? |
@elraphty Please assign me next one? |
@aliraza556 You get the next one |
@elraphty Could you please assign next one? |
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context
Currently, we do not have a test for CreateOrEditFeatures
Design
We want to write the tests to use a real Postgres DB spun up on docker, follow the instructions in the
Unit Testing
section of README.md to run spin up a database in docker, and change thetest_config.go
configuration.After spinning up the Postgres DB container:
TestCreateOrEditFeatures
to connect to the Test DBThe test will throw a dereference error if not connected to a DB.
db.TestDb.CreateOrPerson()
function e.gdb.TestDb.CreateOrEditWorkspace()
function e.gworkspace:= db.TestDb.GetWorkspaceByUuid(workspace.Uuid)
feature
e.gr.Post("/features", featureHandlers.CreateOrEditFeatures)
as a reference, the test routefeatures
and pass it as a body to the Endpoint401
error if a user is not authenticated406
error is returned if the wrong body data is sent to the APi endpoint401
is returned if a Workspace UUID that does not exist Is passed to the API bodyAssertions
db.TestDb.GetFeatureByUuid(feature.uuid)
functionName, Prioty, and Url
returned matches what was sent in the API body.Acceptance Criteria
Here is an example Real DB Test
The text was updated successfully, but these errors were encountered: