You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

51 lines
2.2 KiB

  1. Feature: Create a new post
  2. @javascript
  3. Scenario: Create successfully a new post with a signed in user
  4. Given I am a signed user
  5. And I go to create a new post page
  6. Then I should see 'New post'
  7. And I should not see 'Create an account or sign in now before publishing your post'
  8. And I should see 'Which name would you like to show'
  9. When I fill in 'post[title]' with 'Post title example'
  10. And I choose 'I'm giving away items.'
  11. And I add an item called 'thing'
  12. And I choose a category
  13. And I fill in 'post[description]' with 'This is a post description'
  14. And I fill in 'post[location_attributes][name]' with 'My shop'
  15. And I fill in 'post[location_attributes][street_number]' with '250'
  16. And I fill in 'post[location_attributes][address]' with 'Gladstone avenue'
  17. And I fill in 'post[location_attributes][postal_code]' with 'K2P0Y6'
  18. And I search for this place
  19. And I wait 5 seconds
  20. Then I should see 'Click on the map to locate your exact address'
  21. When I click somewhere on the map
  22. Then I should get new geocodes
  23. And I fill in 'post[location_attributes][phone_number]' with '111222333'
  24. And I fill in 'post[location_attributes][website]' with 'google.ca'
  25. And I fill in 'post[location_attributes][description]' with 'This is how to get here.'
  26. And I click on 'Create this post!' submit button
  27. Then I should see 'The post 'Post title example' has been created. You will shortly receive an e-mail, with the new post details.'
  28. And I should see 'This is how to get here.'
  29. And I should see '111222333'
  30. And I should see 'google.ca'
  31. @javascript
  32. Scenario: The new post page with an anonymous user should show relevant field
  33. Given I am an anonymous user
  34. When I go to create a new post page
  35. Then I should see 'New post'
  36. And I should see 'Create an account or sign in now before publishing your post'
  37. And I should see 'Location name'
  38. And I should see 'About you'
  39. And I should see 'Captcha'
  40. Scenario: I visit a post detail page, after this post has been created.
  41. Given I am an anonymous user
  42. And a post exists
  43. When I go visit that post detail page
  44. Then I should see 'Back to home page'
  45. When an area-only post exists
  46. And I go visit that post detail page
  47. Then I should see 'Back to home page'