-
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 CreateOrEditFeaturePhase #1832
Labels
Comments
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 CreateOrEditFeaturePhase
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:
TestCreateOrEditFeaturePhase
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)
db.TestDB.CreateOrEditFeature()
function e.gfeaturePhase
e.gr.Post("features/phase", featureHandlers.CreateOrEditFeaturePhase)
as a reference, the test routefeaturePhase
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 Feature UUID that does not exist Is passed to the API bodyAssertions
db.TestDb.GetFeaturePhaseByUuid(featurePhase.Uuid)
functionName, Prioty, and FeatureUuid
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: