Embed presentation
Download to read offline






![it only expects one thing
describe '#create' do
it 'creates a new user' do
User.count.should == @count + 1
end
it 'sets a flash message' do
flash[:notice].should be
end
it "redirects to the new user's profile" do
response.should redirect_to(user_path(assigns(:user)))
end
end](https://image.slidesharecdn.com/testbestpractices-111215042110-phpapp02/85/Do-your-test-7-320.jpg)







![Cucumber helps you
Feature: Search engine optimization
In order to find company
As a future customer
I want to find company in google
Scenario: Find company in google
Given I ask google for "company"
Then I should see "http://company.url"
$ cucumber
...
Given /^I ask google for "([^"]*)"$/ do |arg1|
pending
end
#Gemfile
gem "cucumber-rails-training-wheels", :group => :test](https://image.slidesharecdn.com/testbestpractices-111215042110-phpapp02/85/Do-your-test-15-320.jpg)






The document provides best practices and recommendations for writing tests using RSpec and Cucumber. It discusses organizing tests with descriptive names, using contexts and examples to structure expectations, preferring explicit tests over implicit, and using RSpec and Cucumber options and profiles to customize test runs. Links to additional resources on RSpec and Cucumber best practices are also included.






![it only expects one thing
describe '#create' do
it 'creates a new user' do
User.count.should == @count + 1
end
it 'sets a flash message' do
flash[:notice].should be
end
it "redirects to the new user's profile" do
response.should redirect_to(user_path(assigns(:user)))
end
end](https://image.slidesharecdn.com/testbestpractices-111215042110-phpapp02/85/Do-your-test-7-320.jpg)







![Cucumber helps you
Feature: Search engine optimization
In order to find company
As a future customer
I want to find company in google
Scenario: Find company in google
Given I ask google for "company"
Then I should see "http://company.url"
$ cucumber
...
Given /^I ask google for "([^"]*)"$/ do |arg1|
pending
end
#Gemfile
gem "cucumber-rails-training-wheels", :group => :test](https://image.slidesharecdn.com/testbestpractices-111215042110-phpapp02/85/Do-your-test-15-320.jpg)




