code_junkie

What is the best way to start Unit and Functional testing of a Ruby Rails website?

Nov 11th, 2011
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. describe "hello_world"
  2. it "should say hello to the world" do
  3. # RSpec comes with its own mock-object framework built in,
  4. # though it lets you use others if you prefer
  5. world = mock("World", :population => 6e9)
  6. world.should_receive(:hello)
  7. hello_world(world)
  8. end
  9. end
  10.  
  11. Story: Commenting on articles
  12.  
  13. As a visitor to the blog
  14. I want to post comments on articles
  15. So that I can have my 15 minutes of fame
  16.  
  17. Scenario: Post a new comment
  18.  
  19. Given I am viewing an article
  20. When I add a comment "Me too!"
  21. And I fill in the CAPTCHA correctly
  22. Then I should see a comment "Me too!"
Add Comment
Please, Sign In to add comment