Advertisement
Guest User

Untitled

a guest
Sep 25th, 2015
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. behat.yml:
  2.  
  3. default:
  4. suites:
  5. default:
  6. contexts:
  7. - FeatureContext:
  8. service: '@user.service'
  9. extensions:
  10. BehatMinkExtension:
  11. base_url: http://api.localhost.dev
  12. goutte: ~
  13. selenium2: ~
  14. BehatSymfony2Extension: ~
  15.  
  16. config_test.yml:
  17. ...
  18. doctrine:
  19. dbal:
  20. host: 127.0.0.1
  21. dbname: my-db-test
  22. user: root
  23. password: root
  24.  
  25. config_dev.yml:
  26. ...
  27. doctrine:
  28. dbal:
  29. host: 127.0.0.1
  30. dbname: my-db-dev
  31. user: root
  32. password: root
  33.  
  34. Scenario: Create a programmer
  35. Given I have the payload:
  36. """
  37. {
  38. "name": "John",
  39. "lastname" : "Doe",
  40. "username": "john.doe",
  41. "email": "john.doe@email.com",
  42. "password": "password",
  43. "birth": "10/10/1970",
  44. "type": "normal"
  45. }
  46. """
  47. When I request "POST" "/users"
  48. Then the response status code should be "201"
  49. And the "Location" header should be "http://api.localhost.dev/users/john.doe"
  50.  
  51. /**
  52. * @BeforeScenario
  53. */
  54. public function clearData()
  55. {
  56. $this->_service->deleteUsers();
  57. }
  58.  
  59. | name | lastname| username | email | password |birth | type|
  60. | John | Doe | john.doe |john.doe@email.com | password | 10/10/1970 | normal |
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement