Iteration 3: Spec and Deliverables

Iteration 3: Extend, Polish, and Ship

Iteration 3 is the last one. There are no new external services to wire up: you extend the feature your team chose in Iteration 2, deliver one story of your own choosing, and bring ActionMap to release quality. Keep writing tests as you go and keep coverage for the app/ directory at or above 75%; coverage above 80% earns extra credit.

As in the earlier iterations, start with a planning meeting, turn the spec below into stories, and enter each story as a GitHub Issue labelled “iter3”.

Iteration 3, Part 1: Extend your Iteration 2 feature

Your team continues with the option it chose in Iteration 2. Teams that implemented the News API option build ratings on top of it; teams that implemented the Congress.gov option connect bills to the representatives in the database.

Option 1 (News API): Add Ratings to News Articles

As you were working on the prior tasks, the customer decided they want the app to include a way for users to rate articles. A rating system is only as useful as the number of people giving a rating, so individual users rate an article and everyone sees the average.

  • TASK 3.1: Add a Rating model and migration. A news_item should has_many ratings, and a user should has_many ratings. A rating is a score from 1 to 5 by one user on one article; a user can rate a given article only once (updating their rating is fine).
  • TASK 3.2: Let a logged-in user rate an article from the article’s page, and show the user their own rating when they come back.
  • TASK 3.3: Show the average rating (and how many ratings it is based on) wherever an article is listed. The news item table will need an additional column for the average, kept up to date as ratings are added or changed.
  • TASK 3.4: Add a page that lists the ratings a user has given, with a link to each article, and link to it from the user’s own pages.

Option 2 (Congress.gov): Track Bills to Congress Members

We’ve only begun to scaffold searching for bills. Now connect what you save with the representatives the app already knows about.

  • TASK 3.1: In addition to searching congress.gov, the bills index page (/bills) should also show all the bills saved to the ActionMap database, each with a link to “View” it.
  • TASK 3.2: When a bill is saved, use the additional congress.gov APIs to fetch its sponsors and co-sponsors, and match them against the representatives saved in the database. Names will not always match exactly; be deliberate about how you match, and write tests for the cases you handle.
  • TASK 3.3: Adapt the data model so that a bill is associated with the representatives who sponsor it (a bill has many sponsoring representatives; a representative has many bills).
  • TASK 3.4: When viewing a representative, if they have any bills saved, show a list of those bills (title and number) linking to each bill’s page. On a bill’s page, list its sponsors with links to each representative.

Either option touches an external API (the News API or congress.gov), so stub it in your tests the way you did in Iteration 2; a test that calls the real service is a test that fails when the network does.

Iteration 3, Part 2: One story of your own

Your team chooses one additional user-visible feature, writes it up as a story with scenarios before building it, and delivers it. Agree on it with course staff at (or right after) your planning meeting so that it is the right size: about a day’s work for a pair, including tests, and something a user of ActionMap would notice. Some ideas:

  • Filter or search news articles by issue across all representatives, with a page per issue.
  • Show upcoming events on the county page, and let users mark events they plan to attend.
  • A user profile page that gathers everything a user has contributed: articles, ratings, saved bills.
  • Pagination and sorting on the representatives, news and bills tables.
  • Search by any address (not only ones on the map) with a clear error when geocoding fails.
  • Complete the remaining CRUD operations for bills, and search bills by date or title (Option 2 teams).

TASK 3.5: Deliver your story: issue, scenarios, code, tests, pull request, deployment.

Iteration 3, Part 3: Release quality

TASK 3.6: Accessibility. Add scenarios to features/accessibility.feature for at least two routes you added or changed in Iterations 2 and 3, and fix any violations axe reports on them. Every page your team added over the course of the project should now be covered by an accessibility scenario. Run them with:

bundle exec cucumber -p a11y

TASK 3.7: No regressions. Everything from Iterations 1 and 2 still works on the deployed app: the representatives search and map, representative profiles, the news item workflow (or bills search), and login with Google or GitHub. Re-run the whole suite (bundle exec rspec, bundle exec cucumber, and the accessibility profile) before every pull request, and click through the deployed app before you record your video.

TASK 3.8: Coverage. Keep coverage for app/ at or above 75%. Use the coverage report to find the files your Iteration 3 work left untested, and prefer tests that exercise behaviour (controller and request specs, Cucumber scenarios) over tests that only load code.

TASK 3.9: Deployed and documented. Your deployed app runs the final code, with the credentials it needs set. Update the repo’s README so that a new developer could run the app, run the tests, and find the deployed URL.

Iteration 3 Deliverables

Congratulations on finishing ActionMap! The deliverables are the same four as in the earlier iterations: planning meeting; code submission; video, links, and assessment; and the individual retrospective (see Overview and Grading). In the video, demo the Iteration 3 work and give a short tour of the whole app as it stands. In the retrospective, since there is no next iteration, write down what you would do first if the project continued.


This site uses Just the Docs, a documentation theme for Jekyll.