A sample project demonstrating how to do Test-Driven Development in Rails using RSpec.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
bin
config
db
public
spec
.gitignore
.rspec
.ruby-version
Gemfile
Gemfile.lock
LICENSE.txt
README.md
Rakefile
config.ru

README.md

Learn TDD in Rails

A sample project demonstrating how to do Test-Driven Development in Rails using RSpec.

Usage

This repo shows the process of going from an empty Rails installation to a single complete feature built via TDD: the ability to create a blog post. To follow along with the TDD process, view the commit history for the repo. Each step either adds a failing test (red), or adds production code that gets past an error message or causes the test to pass (green). You can checkout any commit to see the state of the codebase at that time and run the tests yourself.

To set up the database, run:

bin/rake db:create
bin/rake db:setup

Then:

  • To run the tests, run bin/rake
  • To run the app, run bin/rails s

Contributing

We welcome contributions to this repo and any other part of Learn TDD! See the Learn TDD Contributing page for info.

License

MIT. For more info, see LICENSE.txt.