Skip to content

Commit

Permalink
test mgmt api user products on company update
Browse files Browse the repository at this point in the history
CPCN-515
  • Loading branch information
petrjasek committed Dec 15, 2023
1 parent f004206 commit ee886de
Showing 1 changed file with 44 additions and 11 deletions.
55 changes: 44 additions & 11 deletions server/features/mgmt_api_companies.feature
Original file line number Diff line number Diff line change
Expand Up @@ -97,30 +97,53 @@ Feature: Management API - Companies
"contact_name": "zzz company",
"contact_email": "[email protected]",
"phone": "99999999",
"sections": {"wire": true, "agenda": true},
"products": [
{"_id": "#products._id#", "section": "wire"}
]
}
"""
Then we get error 400
Then we get response code 201

When we get "/companies/#companies._id#"
Then we get existing resource
"""
{"code": 400, "message": "invalid product type for product #products._id#, should be agenda"}
{
"products": [
{"_id": "#products._id#", "section": "agenda"}
]
}
"""

When we post to "/companies"
When we post to "/users"
"""
{
"name": "zzz company",
"contact_name": "zzz company",
"contact_email": "[email protected]",
"phone": "99999999",
"first_name": "John",
"last_name": "Cena",
"email": "[email protected]",
"company": "#companies._id#",
"sections": {
"wire": true,
"agenda": true
},
"products": [
{"_id": "#products._id#", "section": "agenda"}
{"_id": "#products._id#", "section": "wire"}
]
}
"""
Then we get response code 201

When we get "/users/#users._id#"
Then we get existing resource
"""
{
"products": [
{"_id": "#products._id#", "section": "agenda"}
]
}
"""


When we patch "/companies/#companies._id#"
"""
{
Expand All @@ -129,14 +152,24 @@ Feature: Management API - Companies
]
}
"""
Then we get error 400
Then we get response code 200

When we patch "/companies/#companies._id#"
When we get "/companies/#companies._id#"
Then we get existing resource
"""
{
"products": [
{"_id": "#products._id#", "section": "agenda", "seats": 0}
]
}
"""

When we get "/users/#users._id#"
Then we get existing resource
"""
{
"products": [
{"_id": "#products._id#", "section": "agenda"}
]
}
"""
Then we get response code 200

0 comments on commit ee886de

Please sign in to comment.