SA4-PT Practice Test: Forms and Actions for Managing Model Objects

Extra Setup — Important

From this SA forward, the RSpec tests require that ChromeDriver be installed.

How to Start

  1. Access the GitHub organization’s repositories page.
  2. Create a new repository from the template.
    • Click the New repository button at the top-right of the page.
    • Fill out the Create a new repository form as follows:
      • Repository template: Select template-sa4-pt.
      • Owner: Select comp-7012-s25.
      • Repository name: Use the form below to generate the name for your repository.
        • It is required that your repository’s name precisely follow the format produced by the form.
      • Select Private, so that only you and your instructors can access your repository.
    • Click the Create repository button at the bottom right of the page.
  3. cd into your workspace folder.
  4. git clone the repo you created above.
  5. cd into the new working tree.
  6. Open the working directory in VS Code, bundle install/rails db:migrate && rails db:seed, and begin the practice test.

sa4-pt-hsimpson-1

Task

The aim of this project is enable users to make a playlist of songs (also called tracks). The project already includes a Track model class, as per this class diagram:

In addition to this model class, the project also already includes the following:

If you initialize and run the app, you will see that the index page looks like this:

Screenshot of a web browser displaying an index page for tracks that includes a table with two columns, number and track, and five rows of track records

And the show pages look like this:

Screenshot of a web browser displaying a show page with a top heading that says #2 Sweet Child O'Mine and bullet list of data about the track, including artist and length

Task to perform: You must add new/create, edit/update and destroy functionality for Track objects.

Detailed Specifications

Existing Functionalities

New Functionalities

Additional Constraints:

Note: Italicized requirements will be manually confirmed by the graders.

Testing Your Work with RSpec

Each of the feature stories above corresponds to an RSpec feature spec. These tests (and others for the additional constraints) have been provided in the repository to help you check whether your implementation meets the requirements.

  1. Read through the detailed specifications first. Understand what is required for each page and scenario.
  2. Approach 1 - for those familiar with Test-Driven Development (TDD):
    • Run rspec spec/features to execute the feature tests.
    • Try to write the minimum amount of code needed to make each test pass.
    • Watch the tests fail and pass as you meet each requirement.
    • At the end, run all the provided tests with the rspec command to check if everything passes.
      • Note that not all tests are feature tests, so it is necessary to run rspec at the end to ensure that all tests are run.
  3. Approach 2 - for those less experienced with testing:
    • Work through the specifications step by step, ensuring your implementation meets each requirement.
    • Once you’ve completed your implementation, run all the tests with the rspec command to check if everything passes.

Either of the above approaches is fine, as long as all tests pass by the end.

How to Submit

Once you’ve completed the task and confirmed that all tests pass, perform the follow steps to submit your work.

  1. Commit your changes and push them to GitHub.
    • git add -A
    • git commit -m "Completed SA4-PT Practice Test"
    • git push
  2. Take screenshots.
    • Open your Rails app in the browser and take the following screenshots:
      • sa4-pt-01: The Tracks index page (/tracks).
      • sa4-pt-02: The Track show page for “Total Eclipse of the Heart” (/tracks/3).
      • sa4-pt-03: The Track new page (/tracks/new).
      • sa4-pt-04: The Track edit page for “Total Eclipse of the Heart” (/tracks/3/edit).
    • Ensure that your desktop background or terminal prompt with your unique username is visible in the screenshot.
  3. Submit to Canvas.
    • A Word DOCX that contains:
      • The link to your GitHub repository where your code is hosted.
      • The screenshots.