Michael Wagner sunglasses io Eval#168
Open
Michael-Wagner459 wants to merge 5 commits intoprojectshft:masterfrom
Open
Michael Wagner sunglasses io Eval#168Michael-Wagner459 wants to merge 5 commits intoprojectshft:masterfrom
Michael-Wagner459 wants to merge 5 commits intoprojectshft:masterfrom
Conversation
| description: Unauthorized - User not authenticated. Please sign in | ||
| post: | ||
| tags: | ||
| - 'User' |
There was a problem hiding this comment.
I would have separated User actions like login with the Cart actions. In the future when your application is bigger, it wont be sustainable.
| type: array | ||
| items: | ||
| $ref: '#/definitions/Brand' | ||
| /store/brands/{Id}/products: |
There was a problem hiding this comment.
make sure to use lowercase for id.
Suggested change
| /store/brands/{Id}/products: | |
| /store/brands/{id}/products: |
| name: product | ||
| required: true | ||
| schema: | ||
| type: object |
Comment on lines
+181
to
+184
| 404: | ||
| description: Item not found or Item not in cart | ||
| 400: | ||
| description: Quantity must be at least 1 |
There was a problem hiding this comment.
this ones should also be in the DELETE api
|
|
||
| describe('/store/brands/:id/products', () => { | ||
| it('should get a item based off of Id', (done) => { | ||
| let id = 1; |
| .get('/store/products') | ||
| .end((err, res) => { | ||
| res.should.have.status(200); | ||
| res.body.should.be.an('array'); |
There was a problem hiding this comment.
this is not really testing anything as the array will be empty and the test will pass. If it was a real scenario and this request should be actually returning products, you will have serious bug in your application as it will be passing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Had to hardcode some items in the cart and a user access token in the user database to run some tests. Gonna work on that issue in the future to make it better