Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend [Integration Test] bounty.go handlers MakeBountyPayment #1563

Closed
2 tasks
elraphty opened this issue Feb 27, 2024 · 3 comments
Closed
2 tasks

Backend [Integration Test] bounty.go handlers MakeBountyPayment #1563

elraphty opened this issue Feb 27, 2024 · 3 comments
Assignees
Labels
backend go Pull requests that update Go code Posted testing
Milestone

Comments

@elraphty
Copy link
Contributor

Context

We are trying to increase the test coverage for our Golang backend.

File to to test

handlers/bounty.go

Design

Write tests for the bounty handlers, the test should:

  • Should test that the handler gets locked by go mutex when it is called i.e. the handler has to be fully executed before it processes another request.
  • Should test that a 401 unauthorized error is returned when an unauthorized user hits the endpoint gobounties/pay/{id}
  • Should test that a 405 is returned when a user tries to pay an already-paid bounty
  • Should test that a 401 error is returned if the user is not the organization admin or does not have a PAY BOUNTY role
  • Should test that a 403 error is returned when the amount to be paid exceeds the organization's budget balance.

Bounty Handlers To Test

MakeBountyPayment

Add tests to bounty_test.go

Acceptance Criteria

  • I have rebased and tested locally before submitting my PR
  • I can submit a PR within 2 days of taking the bounty

References

Here is an example backend test

@elraphty elraphty added backend go Pull requests that update Go code testing labels Feb 27, 2024
@elraphty elraphty added this to the UCI Tests milestone Feb 27, 2024
@AbdulWahab3181
Copy link
Contributor

@ecurrencyhodler could you please assign me?

@MirzaHanan
Copy link
Contributor

Hi @ecurrencyhodler,
Please assign me?

@ecurrencyhodler
Copy link
Contributor

Paid 200k sats! https://community.sphinx.chat/bounty/1587

@github-project-automation github-project-automation bot moved this from 🧨 To Do to ✅ Done in Bounties Platform Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend go Pull requests that update Go code Posted testing
Projects
Status: ✅ Done
Development

No branches or pull requests

4 participants