-
Notifications
You must be signed in to change notification settings - Fork 36
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
in5piration-board - Sea Turtle Group 5 (Danielle, Gelly, Olive, Tiffini) #32
base: main
Are you sure you want to change the base?
Conversation
…rom_json class method to Board
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice looking API folks! Let me know if you have any questions on the feedback =]
from app.models.board import Board | ||
from .routes_helper import get_record_by_id, make_record_safely | ||
|
||
card_bp = Blueprint('card_bp', __name__, url_prefix="/boards/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For clarity of naming, if the routes in this file are all prefixed with boards
I might consider naming the file something like board_card_routes
to help imply the nesting.
I would also consider, should all the routes be nested under /boards
? The routes to delete and like a card don't require a board id, so it could make sense to simplify those routes to something like /cards/<card_id>
.
@@ -0,0 +1,23 @@ | |||
from flask import jsonify, abort, make_response | |||
|
|||
def error_message(message, status_code): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️ helper functions!
assert response.status_code == 200 | ||
assert len(Board.query.get(1).cards) == 2 | ||
|
||
def test_like_card(client, one_card): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice test suite! Some other considerations could be around what happens when you like a card that doesn't exist, or when you try to add a card to a board that doesn't exist.
No description provided.