Skip to content

Rails Generators for Cucumber with localized steps for Capybara and Webrat

License

Notifications You must be signed in to change notification settings

marxarelli/cucumber-rails

 
 

Repository files navigation

Cucumber-Rails

Cucumber-Rails brings Cucumber to Rails2 and Rails3. It contains 2 generators - one for bootstrapping your Rails app for Cucumber, and a second one for generating features.

Cucumber-Rails also contains Cucumber Step Definitions that wrap Capybara or Webrat, giving you a head start for writing Cucumber features against your Rails app.

Installation

Rails 3:

Before you can use the generator, add the gem to your project’s Gemfile as follows:

group :test do
  gem 'cucumber-rails'
  gem 'capybara'
  gem 'database_cleaner'
end

Then install it by running:

bundle install

Learn about the various options:

ruby script/rails generate cucumber:install --help

Finally, bootstrap your Rails app, for example:

rails generate cucumber:install

Rails 2.x:

Before you can use the generator, install the gem by running:

gem install cucumber-rails

Learn about the various options:

ruby script/generate cucumber --help

Finally, bootstrap your Rails app, for example:

ruby script/generate cucumber --rspec --capybara

Generating a Cucumber feature

IMPORTANT: Only do this if you are new to Cucumber. We recommend you write your Cucumber features by hand once you get the hang of it.

Rails 3:

Example:

ruby script/rails generate cucumber:feature post title:string body:text published:boolean
ruby script/rails generate scaffold post title:string body:text published:boolean
rake db:migrate
rake cucumber

Rails 2:

Example:

ruby script/generate feature post title:string body:text published:boolean
ruby script/generate scaffold post title:string body:text published:boolean
rake db:migrate
rake cucumber

About

Rails Generators for Cucumber with localized steps for Capybara and Webrat

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%