Skip to content

Instantly share code, notes, and snippets.

@emachnic
Created May 18, 2011 13:14
Show Gist options
  • Save emachnic/978549 to your computer and use it in GitHub Desktop.
Save emachnic/978549 to your computer and use it in GitHub Desktop.
Outline for Capygration Screencast

Capygration - Integration Testing Using Capybara and RSpec

Introduction, Assumptions, Problem, & Solution - Slides

  1. This screencast is for beginning Rails developers but will benefit seasoned veterans
  2. Cucumber is getting the hype lately because of it's syntax (show Gherkin syntax). Nice syntax comes with a lot of overhead (show file tree to manage feature).
  3. Wouldn't it be nice to get great syntax in integration tests and only have to manage one file to do so?
  4. Enter Capybara, created by Jonas Nicklas (show Capybara Github page)

Desktop demo - Code

  1. Show base app and adding Capybara.
  2. Show creating integration test for Project creation
  3. Show running the test
  4. Show creating Projects scaffold and getting the test to green

Advanced Usage - Slides

  1. Show some advanced syntax taken from Github

Challenge - Slides

  1. Challenge users to convert existing Cucumber steps or just start using Capybara in next app

Capygration Code Outline

  1. Inside Gemfile add gem 'capybara'
  2. $ bundle
  3. Add require 'capybara/rspec' to spec_helper.rb
  4. Open new file spec/integration/user_creates_a_project.rb
  5. Fill in steps to create a project
  6. Run test in Terminal - $ bundle exec rspec spec/integration/user_creates_a_project.rb
  7. Generate Project scaffold - $ rails g scaffold Project name:string description:text
  8. Migrate db - rake db:migrate && rake db:test:prepare
  9. Run test in Terminal again - $ bundle exec rspec spec/integration/user_creates_a_project.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment