Skip to content

Commit

Permalink
added url encode to bounty test
Browse files Browse the repository at this point in the history
  • Loading branch information
elraphty committed Nov 6, 2024
1 parent a3f9975 commit 6a46544
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions handlers/bounty_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"log"
"net/http"
"net/http/httptest"
"net/url"
"os"
"strconv"
"strings"
Expand Down Expand Up @@ -1418,7 +1419,8 @@ func TestMakeBountyPayment(t *testing.T) {
bHandler2.getSocketConnections = mockGetSocketConnections
bHandler2.userHasAccess = mockUserHasAccessTrue

memoText := fmt.Sprintf("Payment For: %ss", bounty.Title)
memoData := fmt.Sprintf("Payment For: %ss", bounty.Title)
memoText := url.QueryEscape(memoData)

expectedUrl := fmt.Sprintf("%s/payment", config.RelayUrl)
expectedBody := fmt.Sprintf(`{"amount": %d, "destination_key": "%s", "text": "memotext added for notification", "data": "%s"}`, bountyAmount, person.OwnerPubKey, memoText)
Expand Down Expand Up @@ -1466,7 +1468,8 @@ func TestMakeBountyPayment(t *testing.T) {
bHandler.getSocketConnections = mockGetSocketConnections
bHandler.userHasAccess = mockUserHasAccessTrue

memoText := fmt.Sprintf("Payment For: %ss", bounty.Title)
memoData := fmt.Sprintf("Payment For: %ss", bounty.Title)
memoText := url.QueryEscape(memoData)

expectedUrl := fmt.Sprintf("%s/payment", config.RelayUrl)
expectedBody := fmt.Sprintf(`{"amount": %d, "destination_key": "%s", "text": "memotext added for notification", "data": "%s"}`, bountyAmount, person.OwnerPubKey, memoText)
Expand Down

0 comments on commit 6a46544

Please sign in to comment.