Simple Rails todo app, with tiny commits to demonstrate TDD with cucumber and rspec
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
bin
config
db
features
lib
log
public
script
spec
vendor/assets
.gitignore
.rspec
Gemfile
Gemfile.lock
README.md
Rakefile
config.ru

README.md

Sample "to-do" Rails app

Created for a demo of TDD with http://rubyonrails.org/, using http://rspec.info/ and https://cukes.info/.

This is an extremely basic to-do app. It currently allows creation of new items and marking of items as done, but nothing else. There is also no input validation, error-checking etc.

To run the app:

rake db:migrate
bin/rails s

Then go to localhost:3000 in your browser.

To run the tests:

rake

See full commit messages for step-by-step description. Where files were changed by running a command rather than manually, that step will be a separate commit, with the command(s) listed in the commit message.

To check out a specific version of the code:

git log

Find the SHA of the commit you want to check out, then:

git checkout <SHA>
rake db:reset

The steps in the history are more-or-less as I actually did them, but a glance at the commit dates will make it obvious that I've gone back and rebased a couple of things where I missed something out or changed my mind, in order to keep a clean narrative.

To keep things simple, we're not using any additional testing tools apart from RSpec and Cucumber (apart from Database Cleaner and Capybara, which Cucumber depends on by default). In a real project, some or all of the following might be useful:

Personally, I'd also use haml instead of erb for the view templating, but we're sticking with the default here for simplicity.