Server Test Specifications - Pancia/UniBull GitHub Wiki

TODO: replying to a reply

  • given that you are enrolled
    • with required info
      • should add reply to reply's replies
      • should return {action: "refresh"}
      • should add reply to user's submissions
    • without required info
      • should return an error
  • given that you are not enrolled
    • should return an error

TODO: flagging a thread/reply

  • given that you are enrolled
    • with required info (reason for flagging)
      • should add reason to item's flag list
    • without required info
      • should return an error
  • given that you are not enrolled
    • should return an error

Current Mocha Output


  testing class endpoints
    creating a class
      with valid info
        that does NOT already exist
          ✓ should return the class information
          ✓ should add it to the list of all classes
          ✓ should redirect to the new class page
        that already exists
          ✓ should return an error
          ✓ should redirect to the existing class
      with invalid info
        ✓ should return an error
    getting all the classes
      ✓ should return a list of all the classes
    joining an existing class
      that you are NOT enrolled in
        ✓ should redirect to the class page
        ✓ should add it to the users classes (373ms)
      that you ARE enrolled in
        ✓ should return an error (376ms)

  testing menu endpoints
    when getting the menu
      from nine for today
        - should contain a title, name, and meals

  testing reply endpoints
    replying to a thread
      given that you are enrolled in that thread's class
        with required info
          ✓ should add the reply to that thread's replies
          ✓ should add the reply to the user's replies
          ✓ should return the newly created reply
    replying to a reply
      given you are enrolled
        with required info
          ✓ should add the reply to the reply's replies (39ms)
          ✓ should add it to the user's replies (53ms)
    replying to a nested reply
      given you are enrolled
        with required info
          - should add the reply to the reply's replies
          ✓ should be visible when getting all replies under a thread (57ms)
    getting all replies under a thread
      ✓ should return a list of all the replies

  testing thread endpoints
    creating a thread in a class
      that you are enrolled in
        with required info
          ✓ should add the thread to the class
          ✓ should return {action: 'refresh'}
          ✓ should add it to the user's threads (39ms)
        without required info
          ✓ should return an error
      that you are NOT enrolled in
        ✓ should return an error
    viewing all threads in a class
      ✓ should return a list of all the threads in the class
    edting a thread in a class
      that you created
        ✓ should update the title and content of that thread
      that you did not create
        ✓ should return an error (357ms)
    deleting a thread from a class
      that you created
        ✓ should remove that thread from that class
      that you did not create
        ✓ should return an error (361ms)

  testing user endpoints
    without authentication
      ✓ GET '/' should return a list of all users
      ✓ POST '/restricted' should be unauthorized
    logging in
      with invalid credentials
        ✓ (none) should return an error
        ✓ (only username) should return an error
        ✓ (both) should return an error (346ms)
      with valid credentials
        ✓ we are auth'd and redirected to '/home' (358ms)
        ✓ we can view restricted pages (345ms)
        ✓ we can access our *public* user info (355ms)
        for a long enough time
          ✓ we are denied access (352ms)
          but we've refreshed the token
            ✓ we are NOT denied access (459ms)
    after signing up
      with valid user info
        ✓ we are auth'd and redirected to /home (344ms)
        ✓ we are auth'd and redirected to '/home' (363ms)
        ✓ we can then login again successfully (702ms)
      when the username is already take
        ✓ should return an error (357ms)


  41 passing (19s)
  2 pending