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 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 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)