SA5-PT Practice Test: Model Associations

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-sa5-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.

sa5-pt-hsimpson-1

Task

The aim of this project is enable users to manage a database of music albums. The project already includes an Album model class and a Track model class, as per this class diagram:

Along with these model classes, the app includes the standard resource-CRUDing pages and UI features for Album model objects (but not for Track objects). It also includes model validations and database seeds. It is recommended that you initialize and run the base app at this point, so you can see what’s there.

Steps to perform:

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 SA5-PT Practice Test"
    • git push
  2. Take screenshots.
    • Open your Rails app in the browser and take these screenshots:
      • sa5-pt-01: The Tracks index page for “Rumours” (/albums/2/tracks).
      • sa5-pt-02: The Track show page for “Come Together” (/albums/3/tracks/7).
      • sa5-pt-03: The Track new page for “The Dark Side of the Moon” (/albums/1/tracks/new).
      • sa5-pt-04: The Track edit page for “Never Going Back Again” (/albums/2/tracks/6/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.