cucumber usage in rails project

Add below gems to your gem file

$ gem'database_cleaner'
$gem'cucumber-rails'
$gem'cucumber'
$gem'rspec-rails'


Then run bundle install from your root directory.

run rake db:migrate

next run the below command in your project

rails g cucumber:install --capybara

$ above command will generate all necessary files

run the below command to write cucumber stories to your application.

$ touch features/support/your_test_file_name.rb

go to the above file and write your application stories

run below command to implement test cases for stories

$ rake cucumber:wip

now we can add the step defination for story in step_defination folder

#features/step_definitions/yourcontroller_steps.rb
Given /^a regexpress that is "(.*)"$/ do |color|
Strawberry.make!(:color => color)
end

Comments

Popular posts from this blog

Rails Memcache issues

Enabling password authentication for new ec2 box | ssh, ssh config, EC2 setup, new user in EC2, PasswordAuthentication

What's the difference between "include" and "require" in Ruby?