GRUGin Poetas

Hands-on Practical BDD with Cucumber

Golden Ruby User Group Meetup - 04-03-2013

Agenda...

  • Brief introduction
  • Poetas overview
  • Challenge overview
  • Hands-on coding
  • Wrap-up by 7:40pm to discuss our experiences

Whoami?

  • Me... Alex Perucchini
  • Application System Engineer (IT - RDI), Rogue Wave Software
  • My roles through the years...
    technical support, web developer, system analyst, system administrator, legacy application fixer-upper, CRM specialist, the hardest working man in IT
  • Loves: Ruby and Rails

Introducing Poetas

Poetas Features

  • Sign-in/Sign-up/Sign-out
  • User Profiles
  • Basic search (using PostgreSQL)
  • Pagination
  • Admin portal
  • Gravatar
  • Poem analyzer
  • Vote functionality
  • Twitter-bootstrap layout

Poetas Features (continued)

  • Tests written in rspec
  • Gems used...
    • Permanent record
    • Kaminari
    • PG
    • Devise
    • Rolify
    • Faker
    • FactoryGirl
    • Cancan

The Tour...

See the application in action... Poetas

GRUGing Poetas...

What needs done...

  • Add tagging functionality
  • Let users choose a favorite poem (limit 3)
  • Allow guest access to read poems
  • Add the ability to promote users to the administrator role
  • Extend search functionality to search by users email address or poems

The Challenge...

  • Choose one feature to add
  • Write a cucumber test
  • Make your test pass

Lets Play Along ...

  • Break into small teams
  • Clone the application poetas
    git clone https://github.com/nexiahome/poetas
  • cd poetas
  • git checkout -b branch_name
  • mv config/database.yml.sample config/database.yml
  • Run...
    • bundle install
    • rake db:create
    • rake db:migrate
    • rake db:populate
    • rake db:test:prepare
    • rails s
  • http://localhost:3000
  • login as admin@test.com... password: foobar
  • Start GRUGin

The Take Away...

What did you learn?

What would you have done differently?

Rspec or Cucumber?

Are BDD and TDD worth the trouble?

Fine (The End)

Thank you for your time!