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

Getting Started

  1. Access the GitHub organization’s repositories page.
    • In your web browser, log into GitHub.
    • Navigate to the repositories page of the memphis-comp-7012-2024-08fall GitHub organization.
  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 memphis-comp-7012-2024-08fall.
      • 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.
    • Once you have filled out all the fields, click the Create repository button at the bottom right of the page.
  3. Clone the repository and set up your local environment.
    • In your terminal, clone the newly created repository into your workspace folder.
    • Set up local repository by following steps similar to those in the Running Apps demo.

sa4-pt-hjsimpson-1

Extra Setup — Important!

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

Windows/WSL Instructions

Run this command in the terminal to install the required packages:

sudo apt install ca-certificates fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils chromium-chromedriver -y

macOS Instructions

Run this command in the terminal to install the required Homebrew Cask:

brew install --cask chromedriver

For both Windows/WSL and macOS, Chrome may need to be restarted in order for ChromeDriver to work.

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 Your Work

Once you’ve completed the task and confirmed that all tests pass:

  1. Commit your changes:
    • Add all your changes:

      git add -A
      
    • Commit your work with a meaningful message:

      git commit -m "Completed SA4 Practice Test"
      
  2. Push your changes to GitHub:
    • Push your commits to the remote repository:

      git push
      
  3. Take Screenshots:
    • Open your Rails app in the browser and take the following screenshots:
      • One of the Tracks index page (/tracks).
      • One of the Track show page for “Total Eclipse of the Heart” (/tracks/3).
      • One of the Track new page (/tracks/new).
      • One of 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.
  4. Submit to Canvas:
    • In Canvas, submit:
      • The specified screenshots of your app running in the browser.
      • The link to your GitHub repository where your code is hosted.
    • You may submit al of the above in a single document.