- Learn how to decompose a problem
- Practice logical reasoning
- Know how to work with lists
- Know how to use functions
- Know how to get user input for a program
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Hello World!</title>
<style media="screen">
body{
background-color: #1B3445;#Rails API Homework
Create a Rails app called shows_api. Your API should return and repond to JSON (i.e. no HTML views required)
The INDEX route should be localhost:3000/api/shows
It's going to have a resource called Shows to manage TV shows and films.
You only have to implement an INDEX and CREATE in the ShowsController (i.e not all the RESTful routes)
- Create a planet_spec.js file for testing
- Create a Planet constructor that takes a name as an argument and make it available to the test file with module.exports
- Write a test that creates a new Planet and checks the Planet has the right name
- Create a SolarSystem constructor that takes in a name and has an initial empty array of planets.
- Export the SolarSystem constructor to make it available to other files
- Test that the SolarSystem has an intial empty array of planets.
- Add a method to the SolarSystem constructor that adds a planet to the array
- Write a test that instantiates a new SolarSystem, some Planets, adds the planets to the SolarSystem and tests the SolarSystem planets array is correct