Skills Assignment SA3-EV: Model Basics Explanation Video

Getting Started

Before proceeding, be sure to read the general instructions for the explanation videos.

  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-sa3-ev.
      • 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.
  4. Start the recording.
    • You may start your screen recording after you have cloned the repository and are ready to start the task (see the EV general instructions).

sa3-ev-hjsimpson-1

Task

You must implement a Rails model class (including migration) as per this class diagram:

You must seed the database (using the seeds.rb script) with the following Course records:

Name Code Credit Hours Professor
Intro to Computer Science CS101 3 Dr. Alice Johnson
Calculus I MATH101 4 Dr. Bob Smith
English Literature ENG201 3 Dr. Carol White
Physics I PHYS101 4 Dr. David Brown
Introduction to Psychology PSY101 3 Dr. Emily Davis

You must create an index page that displays all the Course records stored in the database, like this:

Screenshot of a web browser displaying an index page for courses that includes a table with two columns, name and code, and five rows of course records

Each “Show” link on the index page must link to a show page for the record, and the show pages must look like this:

Screenshot of a web browser displaying a show page with a top heading that says Jaws and bullet list of data about the course, including name, code, credit hours, and professor

Detailed Specifications

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 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 SA3 Explanation Video"
      
  2. Push your changes to GitHub:
    • Push your commits to the remote repository:

      git push
      
  3. Submit to Canvas:
    • In Canvas, submit:
      • The link to your GitHub repository where your code is hosted.
      • The link to your video if you are using Teams to record. (If you are not using Teams, then upload the video file.)
    • You may submit the links in a single document.