Skip to content

Commit

Permalink
Changed modifyGame request method to get (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
sormys authored Apr 29, 2023
1 parent ec2d685 commit ff095c6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/routes/modifyGame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { sendFirebaseMessage, verifyFCMToken } from '../utils/firebase'
import express, { type Router } from 'express'
const router: Router = express.Router()

router.post(
router.get(
'/modifyGame',
rateLimiter,
celebrate({
Expand Down
14 changes: 7 additions & 7 deletions src/tests/modifyGame.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ test('Modify game, wrong args', async () => {
await client
.connect()
.then(async () => {
await request(app).post('/modifyGame').expect(400)
await request(app).post('/modifyGame?creatorToken=2137').expect(400)
await request(app).get('/modifyGame').expect(400)
await request(app).get('/modifyGame?creatorToken=2137').expect(400)

await client.query(insertGameCreator, [2137, '2137', 0])

await request(app).post('/modifyGame?creatorToken=2137').expect(400)
await request(app).get('/modifyGame?creatorToken=2137').expect(400)
await request(app)
.post('/modifyGame?creatorToken=2137&smallBlind=asd')
.get('/modifyGame?creatorToken=2137&smallBlind=asd')
.expect(400)
await request(app)
.post('/modifyGame?creatorToken=2137&startingFunnds=dasdasd')
.get('/modifyGame?creatorToken=2137&startingFunnds=dasdasd')
.expect(400)
await request(app)
.post('/modifyGame?creatorToken=2137&startingFunds=1&smallBlind=220')
.get('/modifyGame?creatorToken=2137&startingFunds=1&smallBlind=220')
.expect(400)
})
.finally(async () => {
Expand Down Expand Up @@ -57,7 +57,7 @@ test('Modify game, correct arguments', async () => {
.expect(200)

await request(app)
.post(
.get(
'/modifyGame?creatorToken='
.concat(gameMasterToken)
.concat('&smallBlind=')
Expand Down

0 comments on commit ff095c6

Please sign in to comment.