Guest User

Untitled

a guest
Jul 20th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. Feature: Addition
  2. In order to avoid silly mistakes
  3. As a math idiot
  4. I want to be told the sum of two numbers
  5.  
  6. Scenario: Add two numbers
  7. Given I visit the calculator page
  8. And I fill in '50' for 'first'
  9. And I fill in '70' for 'Second'
  10. When I press 'Add'
  11. Then I should see 'Answer: 120'
  12.  
  13. Given /^I visit the calculator page$/ do
  14. visit '/add'
  15. end
  16.  
  17. Given /^I fill in '(.*)' for '(.*)'$/ do |value, field|
  18. fill_in(field, :with => value)
  19. end
  20.  
  21. When /^I press '(.*)'$/ do |name|
  22. click_button(name)
  23. end
  24.  
  25. Then /^I should see '(.*)'$/ do |text|
  26. body.should match(/#{text}/m)
  27. end
Add Comment
Please, Sign In to add comment