How to add the first cucumber test to a Rails application

Confession: I have never written a single test for Rails.

I set the gems of cucumber, rspec, capybara, factory girl. Running Rails 3.1.

I'm not sure, um, where you can create a new test file or what to call it.

Thank you for your patience.

+5
source share
3 answers

after installing rspec and cucumber, you should run the following commands

rails creates rspec: install for rspec

rails generate, , , , , rspec

. ,

spec/models/user_spec.rb

rspec spec/models/user_spec.rb

,

rspec

:

, .feature

. ​​, ,

feature/create_user.feature file

/step_definitions/create_user_steps.rb

http://loudcoding.com/posts/quick-tutorial-starting-with-cucumber-and-capybara-bdd-on-rails-project/

+3

, . " ", .

.

+1

All Articles