camp: [hoodie-account-server] Add test for PATCH /accounts/{id} if user is not an admin
ππ»π Hacktoberfest: Trick or Treat!
If you havenβt yet, sign up for Hacktoberfest to earn an exclusive T-Shirt. Plus Iβm sure we can teach you a cool trick or two in the process
π€ What you will need to know
You should have worked with JavaScript, Node.js and Testing. This is a rather advanced issue, you will need to write tests yourself and then resolve the issue. If you havenβt done that before, better look for another issue π
Some knowledge about Hapi will help but you can figure it out if you know the things above π
In order to load a account via GET /accounts/{id}
, the admin must be authenticated with a valid session id. If they are not, the server must respond with 401 invalid session
as per spec. That includes the case where the session id is valid, but the user is not an admin
It probably does that already but we canβt be 100% sure unless we actually test it π
π― The goal
Create an integration test for PATCH /accounts/{id}
with a valid session that belongs to a user account, not an admin account π
π Step by Step
If this is your first, welcome π π Here is a great tutorial on how to send a pull request using the terminal.
- π Claim this issue: Comment below (or assign yourself and continue at step 4 π
Please π only claim if you want to start working on it during the event.
Once claimed we add you as contributor to this repository. - π Accept our invitation to this repository. Once accepted, assign yourself to this repository
- π Please review our Code of Conduct
In a nutshell: be patient and actively kind with us π - π· add the label
in progress
. - π Setup the repository locally and make sure that all tests pass
- Create the test in tests/integration/routes/accounts/patch-accounts-test.js.
- Commit the change with
test(routes): PATCH /accounts/{id} with user session
and push it either to your fork or push your new branch. Your tests should fail now - π Start a Pull Request. Mention
closes hoodiehq/camp#68
in the description. - If the test passes, all good π If the server does not respond as expected, figure out why and fix it π
- π Done π Replace the
in progress
label withready
. Ask in comments for a review π
π€β Questions
Ping us in the Hoodie Chat or on Twitter
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 17 (8 by maintainers)
@LowProfileDog I think Iβll have to give up on that issue π¦ thought i would get it, but i think it is too much at the moment π sorry
@gr2m Thanks! The PR is ready for review π Any feedback appreciated!
I wasnβt too sure about the authorization header, so let me know if itβs not doing what itβs supposed to. π
ah I apologize for taking so long. Got caught up with midterms and group projects. I was planning on making the PR this weekend π
All yours @sharynneazhar π Iβve invited you to this repository: https://github.com/hoodiehq/camp/invitations once accepted, assign yourself to this issue and start working off the list above π Enjoy! And please let us know if you have any questions.