0% found this document useful (0 votes)
2 views

idea-postman-tests

Uploaded by

Arpan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

idea-postman-tests

Uploaded by

Arpan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Postman Test Cases for Idea Route Handler

1. POST: Create a new idea


Endpoint: POST /api/ideas
Request Body:
{
"title": "AI-powered Personal Assistant",
"description": "Develop an AI assistant that can learn and adapt to individual user need
"ownerId": "user_id_here",
"visibility": "PRIVATE"
}
Expected Response: - Status: 200 OK - Body should include the created
idea with owner details

2. GET: Fetch all ideas (public and owned)


Endpoint: GET /api/ideas?ownerId=user_id_here
Expected Response: - Status: 200 OK - Body should include all public ideas
and private ideas owned by the user

3. GET: Fetch a specific idea


Endpoint: GET /api/ideas?id=idea_id_here
Expected Response: - Status: 200 OK - Body should include the full details
of the specified idea, including owner and teammates

4. PUT: Update an idea


Endpoint: PUT /api/ideas?id=idea_id_here
Request Body:
{
"title": "Updated: AI-powered Personal Assistant",
"description": "An advanced AI assistant that can learn, adapt, and anticipate user need
"visibility": "PUBLIC"
}
Expected Response: - Status: 200 OK - Body should include the updated
idea

5. PATCH: Add a teammate to an idea


Endpoint: PATCH /api/ideas?id=idea_id_here

1
Request Body:
{
"action": "addTeammate",
"userId": "new_teammate_id_here"
}
Expected Response: - Status: 200 OK - Body should include the updated
idea with the new teammate

6. PATCH: Remove a teammate from an idea


Endpoint: PATCH /api/ideas?id=idea_id_here
Request Body:
{
"action": "removeTeammate",
"userId": "teammate_id_to_remove"
}
Expected Response: - Status: 200 OK - Body should include the updated
idea without the removed teammate

7. DELETE: Delete an idea


Endpoint: DELETE /api/ideas?id=idea_id_here
Expected Response: - Status: 200 OK - Body should confirm successful
deletion

Notes for testing:


1. Replace user_id_here, idea_id_here, new_teammate_id_here, etc.,
with actual IDs from your database.
2. Ensure you have the necessary authentication set up in Postman (if re-
quired by your API).
3. Test with various valid and invalid inputs to ensure proper error handling.
4. For GET requests, test with different user IDs to verify visibility rules
(public vs. private ideas).
5. For PUT, PATCH, and DELETE operations, test both as the idea owner
and as a non-owner to verify permission handling.

You might also like