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 with ready. 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)

Most upvoted comments

@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.