LC101 assignment
This small, flask-based app implements a blog.
- A blog is a series of entries
- Each entry includes a title and a body
The app must meet several requirements:
- List all previous blog entries in chronological order
- List all previous blog entries in reverse-chronological order
- Allow anybody to create a new blog entry
- Display the individual blog entry after creation
- Include a menu bar with available commands
- No authentication or authorization is required
- All access can be anonymous
- Given I am an anonymous visitor to the site
- When I arrive at the site (route "/")
- Then I see a list of previous blog entries in oldest-first order
- Given I am an anonymous visitor
- When on any page
- Then I can see a menu of actions available to me
- Given I am an anonymous visitor
- When on any page
- And I click on the "List all entries (newest-first)" menu item
- Then I see a list of previous blog entries in newest-first order
- Given I am an anonymous visitor
- When on any page
- And I click on the "List all entries (oldest-first)" menu item
- Then I see a list of previous blog entries in oldest-first order
- Given I am an anonymous visitor
- When I click on the "Create new entry" menu items
- Then I go to the "Create new entry" form page
- And I see a form for entering a title and a body
- Given I am an anonymous visitor
- And I am on the "Create new entry" form page
- When I supply a title
- And I supply a body
- And I click the "Save" button
- Then I see my new entry on a page by itself
- Given I am an anonymous visitor
- And I am on the "Create new entry" form page
- When I DO NOT supply a title
- Or I DO NOT supply a body
- And I click the "Save" button
- Then I see the same form with my given values (if any) for title and body with an error message
- List all entries (oldest-first)
- List all entries (newest-first)
- Create new entry
- "/" - GET: redirect to "/blog"
- "/blog" - GET: Display list of all entries with default sort order (oldest-first)
- "/blog?sort=newest" - GET: Display list of all entries newest-first
- "/blog?entry=ID" GET: Display entry with id=ID
- "/new_entry" - GET: Display new entry form; POST: Process new entry