Your SlideShare is downloading. ×
BDD de fuera a dentro
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

BDD de fuera a dentro

769

Published on

Published in: Technology, Business
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
769
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
9
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. scenario List of users do create_user mary create_user paul visit users_page assert page.has_content?(mary) assert page.has_content?(paul)end
  • 2. scenario List of users do create_user mary create_user paul visit users_page assert page.has_content?(mary) assert page.has_content?(paul)end
  • 3. $ rails g model User name:string
  • 4. scenario List of users do create_user mary create_user paul visit users_page assert page.has_content?(mary) assert page.has_content?(paul)end
  • 5. $ rails g controller users index
  • 6. scenario List of users do create_user mary create_user paul visit users_page assert page.has_content?(mary) assert page.has_content?(paul)end
  • 7. describe users/index.html.erb do it renders the list of users do render_view :users => [mock(:name => Joe)] assert_contains rendered, Joe endend
  • 8. describe users/index.html.erb do it renders the list of users do render_view :users => [mock(:name => Joe)] assert_contains rendered, Joe endend
  • 9. describe users/index.html.erb do it renders the list of users do render_view :users => [mock(:name => Joe)] assert_contains rendered, Joe endend
  • 10. <h2>Users</h2><ul> <%= @users.each do |user| %> <li> <%= user.name %> </li> <% end %></ul>
  • 11. <h2>Users</h2><ul> <%= @users.each do |user| %> <li> <%= user.name %> </li> <% end %></ul>
  • 12. <h2>Users</h2><ul> <%= @users.each do |user| %> <li> <%= user.name %> </li> <% end %></ul>
  • 13. scenario List of users do create_user mary create_user paul visit users_page assert page.has_content?(mary) assert page.has_content?(paul)end
  • 14. describe UsersController do describe GET index do it assigns the users do User.stub(:all => users_stub) get :index assert_equal users_stub, assigns[:user] end endend
  • 15. describe UsersController do describe GET index do it assigns the users do User.stub(:all => users_stub) get :index assert_equal users_stub, assigns[:user] end endend
  • 16. describe UsersController do describe GET index do it assigns the users do User.stub(:all => users_stub) get :index assert_equal users_stub, assigns[:user] end endend
  • 17. describe UsersController do describe GET index do it assigns the users do User.stub(:all => users_stub) get :index assert_equal users_stub, assigns[:user] end endend
  • 18. class UsersController def index @users = User.all endend
  • 19. class UsersController def index @users = User.all endend
  • 20. scenario List of users do create_user mary create_user paul visit users_page assert page.has_content?(mary) assert page.has_content?(paul)end

×