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

email_subscription.feature 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. @subscription
  2. Feature: Email Subscription
  3. In order to send newsletters to customers
  4. As an marketing guy
  5. I want to a email subscription button
  6. Background:
  7. Given the website is configured
  8. And the following subscription list
  9. | first_name | last_name | email |
  10. | Jimy | San | jimysan@website.com |
  11. | John | Doe | john_doe@website.com |
  12. Scenario: Newsletter subscription form
  13. Given I am not logged in
  14. And I visit the homepage
  15. And I should see "Subscribe to our newsletter"
  16. And I fill in "subscription_first_name" with "Monty"
  17. And I fill in "subscription_last_name" with "Cantsin"
  18. And I fill in "subscription_email" with "monty_cantsin@canada.com"
  19. And I click in the button "submit_subscription"
  20. Then I should see "Thanks for subscribing to our newsletter"
  21. And "monty_cantsin@canada.com" should receive an email with subject "Thanks for subscribing"
  22. Scenario: Admin panel email subscription list
  23. Given I am logged in as admin
  24. And I go to the admin dashboard
  25. And I click in the link "Subscribers"
  26. Then I should see "Jimy San"
  27. And I should see "jimysan@website.com"
  28. And I should see "John Doe"
  29. And I should see "john_doe@website.com"
  30. Scenario: Somebody already registered tries to submit to newsletter subscription form
  31. Given I visit the homepage
  32. When I fill in "subscription_first_name" with "Jimy"
  33. And I fill in "subscription_last_name" with "San"
  34. And I fill in "subscription_email" with "jimysan@website.com"
  35. And I click in the button "submit_subscription"
  36. Then I should see "You have already registered to our newsletter"
  37. Scenario: Export subscription list as a CVS file
  38. Given I am logged in as admin
  39. And I go to the subscribers page
  40. When I click in the link "Export CVS"
  41. Then I should see "Jimy,San,jimysan@website.com,"
  42. And I should see "John,Doe,john_doe@website.com"