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

maintenance_mode.feature 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. @focus
  2. Feature: Maintenance Mode
  3. In order to change things in the website
  4. As an admin
  5. I want to close the website for visitors
  6. Background:
  7. Given the website is configured
  8. Scenario: Enable maintenance mode
  9. Given I am logged in as admin
  10. When I go to the configurations page
  11. And the page should have a "input" called "info_maintenance_mode"
  12. Then I check the checkbox called "info_maintenance_mode"
  13. And I fill in "info_maintenance_title" with "Website under maintenance"
  14. And I fill in "info_maintenance_message" with "Please check back soon"
  15. And I click in the button "Update Config"
  16. Then I should see "Configurations saved successfully"
  17. And I go to the homepage
  18. And I should not see "Website under maintenance"
  19. Then I click in the link "Logout"
  20. And I go to the homepage
  21. And I should see "Website under maintenance"
  22. And I should see "Please check back soon"
  23. Scenario: Visitor tries to access page during maintenance mode
  24. Given I am not logged in
  25. And Maintenance mode is activated
  26. When I go to the blog page
  27. Then I should see "Website under maintenance"
  28. Scenario: User login during maintenance mode
  29. Given I am not logged in
  30. And Maintenance mode is activated
  31. When I log in as user
  32. Then I should not see "Website under maintenance"
  33. Scenario: Disable maintenance mode
  34. Given I am not logged in
  35. And Maintenance mode is activated
  36. When I log in as admin
  37. And I go to the configurations page
  38. And I uncheck the checkbox called "info_maintenance_mode"
  39. And I click in the button "Update Config"
  40. And I click in the link "Logout"
  41. And I go to the homepage
  42. Then I should not see "Website under maintenance"