Skip to content

Instantly share code, notes, and snippets.

@BrianZanti
Created March 5, 2021 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BrianZanti/82f464de490e489e7e90412632e1b502 to your computer and use it in GitHub Desktop.
Save BrianZanti/82f464de490e489e7e90412632e1b502 to your computer and use it in GitHub Desktop.

Field Trip

Description

Field Trip is an app that allows a user to see flights and passengers.

  • Flights have many passengers
  • Passengers can have many flights
  • Flights have a number, date, time, departure city, and arrival city
    • Ex: number: “1727”, date: “08/03/20”, departure_city: “Denver”, arrival_city: “Reno” -- for this app, it does not matter how you format the flight’s date
  • Passengers have a name and age
    • Ex: name: “Joe”, age: 7

User Stories

User Story 1, Flights Index Page

As a visitor
When I visit the flights index page
I see each flight in the system including its number, departure city, and arrival city
And I see that flights are listed in alphabetical order by departure city (A - Z)
User Story 2, Flight Show Page

As a visitor
When I visit a flight's show page
Then I see the flight's number, date, time, departure city, and arrival city
And I see the names of all adult passengers on the flight
And I see the average age of all adult passengers on the flight

Note: an "adult passenger" is a passenger whose age is greater than or equal to 18
User Story 3, Remove a Passenger from a Flight

As a visitor
When I visit a flight's show page
Next to each passengers name I see a link or button to remove that passenger from that flight
When I click on that link or button
I'm returned to the flight's show page 
And I no longer see that passenger listed

Extension

Extension Story, Flights sorted by passenger count

As a visitor
When I visit the Flight index
Then I see that flights are ordered by the number of passengers on the flight from most passengers to least

(Note: you should not make a separate query for each flight to calculate the number of passengers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment