/sinatra-todos

The beginning of a todo list!

Primary LanguageRubyGNU General Public License v2.0GPL-2.0

sinatra-todos

  1. Learning Objectives
  2. Instructions
  3. Helpful Resources

Learning Objectives

  1. Deploying an Application to Heroku
  2. Using environment variables to configure your application
  3. Using feature tests to guide your development

Instructions

Your mission, and you choose to accept it, is to get a very small todo list app deployed to Heroku.

  1. Fork this repository to one of your personal github account
  2. Make all the features pass
  3. Push it to heroku
  4. Submit a pull request to this repository for your peers to review. Include a link to your production app in the pull request.
  5. Do NOT merge these pull requests :).
  6. Review other peoples code. Do NOT merge their pull requests.
  7. Add more features if you have time

Features

There are two features in this amazingly powerful todopplication:

  1. Guest may create TODO
  2. Guest may complete TODO

Guest may create TODO

  1. Open spec/features/guest_may_create_todo_spec.rb
  2. Change one line that says xscenario to say scenario
  3. Run the tests
  4. Make that test pass
  5. Commit
  6. Repeat until all scenarios are passing
  7. Verify through the UI the feature works
  8. Push to Heroku

Guest may complete TODO

  1. Open spec/features/guest_may_complete_todo_spec.rb
  2. Change one line that says xscenario to say scenario
  3. Run the tests
  4. Make that test pass
  5. Commit
  6. Repeat until all scenarios are passing
  7. Verify through the UI the feature works
  8. Push to Heroku

Helpful Resources

  1. Heroku and Ruby
  2. Heroku and Sinatra
  3. Heroku Config Variables
  4. Creating a Table With Active Record Migrations
  5. Interacting with Forms in Capybara
  6. Clicking Links or Buttons with Capybara
  7. Creating and Handling Forms with Sinatra

Running the app:

  1. Run rake or rake spec to run the tests
  2. Run shotgun to run the app locally
  3. Run rake db:create_migration NAME=name_of_migration to create a migraton
  4. Run rake db:migrate to run the migrations
  5. Run irb -r ./todo_app.rb to get to a console

Deploying the app

  1. git push heroku pushes the master branch to heroku
  2. heroku run rake db:migrate migrates the database on heroku