Guest User

Untitled

a guest
Dec 8th, 2017
606
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. ##Account.feature
  2. Feature: Authentication
  3. In order to validate zombies
  4. I want to use my account on the website.
  5. Background:
  6. Given the following zombie records
  7. | name | email | password |
  8. | Jakub Rรกฤek | jakub@hotmail.com | jakub |
  9. | Denis Homola | denis@hotmail.com | denis |
  10.  
  11. Scenario: i should be able to login with valid credentials
  12. Given I am on signin page
  13. When I fill in "Email" with "jakub@hotmail.com"
  14. And I fill in "Password" with "jakub"
  15. And I press "Sign in"
  16. Then I should see "Signed in successfully"
  17.  
  18. ##common_steps.rb
  19. Given /^the following (.+) records$/ do |factory, table|
  20. table.hashes.each do |hash|
  21. Factory(factory, hash)
  22. end
  23. end
  24.  
  25. ##spec/factories/zombie.rb
  26. Factory.define :zombie do |f|
  27. f.sequence(:name) { |n| "name#{n}" }
  28. f.password "secret"
  29. f.password_confirmation { |u| u.password }
  30. f.sequence(:email) { |n| "email#{n}@hotmail.com"}
  31. end
  32.  
  33. ## Then I run cucumber and I got Error
  34. No such factory: zombie (ArgumentError)
Add Comment
Please, Sign In to add comment