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

@jinpark => Transform reset endpoint into new_season endpoint, add spec #24

Merged
merged 1 commit into from
Oct 3, 2014

Conversation

ilyakava
Copy link
Owner

This implements an admin like endpoint for clearing the leaderboard - as was recently necessary after very many games in the season.

Resetting the leaderboard both requires the user to be marked as an admin, and know the admin secret (something controlled by whoever is deploying).

@jinpark
Copy link
Collaborator

jinpark commented Sep 30, 2014

Quick lookover 👍

@jinpark
Copy link
Collaborator

jinpark commented Sep 30, 2014

How do I run the tests again?

@jinpark
Copy link
Collaborator

jinpark commented Oct 3, 2014

3 of the specs are not passing for me for this branch

1) help gets the help link:
     Uncaught Error: expected undefined to sort of equal 'https://github.com/andrewvy/opal-pongbot'
      at Assertion.assert (/Users/jinpark/Documents/code/ilya-pongbot/node_modules/expect.js/index.js:96:13)
      at Assertion.eql (/Users/jinpark/Documents/code/ilya-pongbot/node_modules/expect.js/index.js:230:10)
      at /Users/jinpark/Documents/code/ilya-pongbot/test/lib/api.js:16:34
      at Request.callback (/Users/jinpark/Documents/code/ilya-pongbot/node_modules/superagent/lib/node/index.js:738:30)
      at Request.<anonymous> (/Users/jinpark/Documents/code/ilya-pongbot/node_modules/superagent/lib/node/index.js:135:10)
      at Request.emit (events.js:95:17)
      at IncomingMessage.<anonymous> (/Users/jinpark/Documents/code/ilya-pongbot/node_modules/superagent/lib/node/index.js:915:12)
      at IncomingMessage.emit (events.js:117:20)
      at _stream_readable.js:943:16
      at process._tickCallback (node.js:419:13)

  2) new_season clears all records when secret and user are correct:
     Uncaught Error: expected undefined to sort of equal 'Welcome to the new season.'
      at Assertion.assert (/Users/jinpark/Documents/code/ilya-pongbot/node_modules/expect.js/index.js:96:13)
      at Assertion.eql (/Users/jinpark/Documents/code/ilya-pongbot/node_modules/expect.js/index.js:230:10)
      at /Users/jinpark/Documents/code/ilya-pongbot/test/lib/api.js:49:34
      at Request.callback (/Users/jinpark/Documents/code/ilya-pongbot/node_modules/superagent/lib/node/index.js:738:30)
      at Request.<anonymous> (/Users/jinpark/Documents/code/ilya-pongbot/node_modules/superagent/lib/node/index.js:135:10)
      at Request.emit (events.js:95:17)
      at IncomingMessage.<anonymous> (/Users/jinpark/Documents/code/ilya-pongbot/node_modules/superagent/lib/node/index.js:915:12)
      at IncomingMessage.emit (events.js:117:20)
      at _stream_readable.js:943:16
      at process._tickCallback (node.js:419:13)

  3) new_season does not clear records when secret and user are incorrect:
     Uncaught Error: expected undefined to sort of equal 'You do not have admin rights.'
      at Assertion.assert (/Users/jinpark/Documents/code/ilya-pongbot/node_modules/expect.js/index.js:96:13)
      at Assertion.eql (/Users/jinpark/Documents/code/ilya-pongbot/node_modules/expect.js/index.js:230:10)
      at /Users/jinpark/Documents/code/ilya-pongbot/test/lib/api.js:70:34
      at Request.callback (/Users/jinpark/Documents/code/ilya-pongbot/node_modules/superagent/lib/node/index.js:738:30)
      at Request.<anonymous> (/Users/jinpark/Documents/code/ilya-pongbot/node_modules/superagent/lib/node/index.js:135:10)
      at Request.emit (events.js:95:17)
      at IncomingMessage.<anonymous> (/Users/jinpark/Documents/code/ilya-pongbot/node_modules/superagent/lib/node/index.js:915:12)
      at IncomingMessage.emit (events.js:117:20)
      at _stream_readable.js:943:16
      at process._tickCallback (node.js:419:13)`

@ilyakava
Copy link
Owner Author

ilyakava commented Oct 3, 2014

:) I think that is because you have another app running at localhost:3000

@jinpark
Copy link
Collaborator

jinpark commented Oct 3, 2014

gah, thatll do it

everythign passes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants