A website template with lots of features, built with ruby on rails.

contact_messages.feature 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. @contact_messages
  2. Feature: Contact Messages
  3. In order to send a message
  4. As an visitor
  5. I want to send contact messages
  6. In order to receive a messages from visitors
  7. As the site administrator
  8. I want to receive and access contact messages
  9. Background:
  10. Given the website is configured
  11. Scenario: Send Contact Message as a visitor
  12. Given I visit the homepage
  13. When I click in the link "Contact"
  14. Then the page should have a "form" called "new_contact_message"
  15. And I fill in "contact_message_email" with "yo@website.com"
  16. And I fill in "contact_message_title" with "Hello Webmaster"
  17. And I fill in "contact_message_content" with "How are you doing bro?"
  18. And I click in the button "submit_contact_message"
  19. Then I should see "Message sent!"
  20. And "admin@website.com" should receive an email with subject "Hello Webmaster"
  21. Scenario: Send Contact Message as a user
  22. Given I am logged in as user
  23. And I go to the homepage
  24. When I go to the contact page
  25. Then the page should have a "form" called "new_contact_message"
  26. And the page should not have a "input" called "contact_message_email"
  27. And I fill in "contact_message_title" with "Hello Webmaster"
  28. And I fill in "contact_message_content" with "How are you doing bro?"
  29. And I click in the button "submit_contact_message"
  30. Then I should see "Message sent!"
  31. And "admin@website.com" should receive an email with subject "Hello Webmaster"
  32. Scenario: Receive message
  33. Given I go to the contact page
  34. And I fill in "contact_message_email" with "yo@website.com"
  35. And I fill in "contact_message_title" with "Hello Webmaster"
  36. And I fill in "contact_message_content" with "How are you doing bro?"
  37. And I click in the button "submit_contact_message"
  38. Then I should see "Message sent!"
  39. And "admin@website.com" should receive an email with subject "Hello Webmaster"
  40. Then I log in as admin
  41. And I go to the contact messages list
  42. And I should see "Hello Webmaster"