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

blog.feature 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. Feature: Blog Posts
  2. In order to make a blog
  3. As an author
  4. I want to create and manage blog psots
  5. Background:
  6. Given the following blog_post list
  7. | title | content | published | description | slug |
  8. | Hello World | Welcome to the website | true | First Post | hello_world |
  9. | Test 001 | 1 2 3 testing | true | Testing the website | test_001 |
  10. Scenario: Blog posts list
  11. When I go to the blog page
  12. Then I should see "Hello World"
  13. And I should see "First Post"
  14. And I should see "Test 001"
  15. And I should see "Testing the website"
  16. Scenario: Blog post page
  17. When I go to the blog page
  18. And I click in the link "Hello World"
  19. Then I should see "Hello World"
  20. And I should see "Welcome to the website"
  21. And The current url should be "/blog/hello_world"
  22. Scenario: New blog post
  23. Given I am logged in as admin
  24. Then I click in the link "Admin Panel"
  25. And I click in the link "Posts"
  26. And The current url should be "/admin/posts"
  27. Then I click in the link "New Post"
  28. And The current url should be "/admin/posts/new"
  29. Then I fill in "Title" with "Test 002"
  30. And I fill in "Slug" with "test_002"
  31. And I fill in "Description" with "Another blog post test"
  32. And I fill in "post_content" with "This is blog post test number 002!"
  33. And I click in the button "Save"
  34. Then I should see "Test 002"
  35. And I should see "This is blog post test number 002!"
  36. And I should see "Admin"
  37. Scenario: Delete blog post
  38. Given I am logged in as admin
  39. Then I click in the link "Admin Panel"
  40. Then I click in the link "Posts"
  41. And The current url should be "/admin/posts"
  42. Then I should see "Hello World"
  43. And I should see "Test 001"
  44. Then I click in the link "delete_hello_world"
  45. Then I should see "Test 001"
  46. And I should not see "Hello World"
  47. Scenario: Only admin users can see edit blog post button
  48. Given I go to the blog page
  49. And I click in the link "Hello World"
  50. Then I should not see the link "edit_hello_world"
  51. Then I log in as admin
  52. And I go to the blog page
  53. And I click in the link "Hello World"
  54. Then I should see the link "edit_hello_world"
  55. Scenario: Only admin users can access the blog posts admin page
  56. Given I go to the blog page
  57. Then I should not see the link "navlink_admin_panel"
  58. Then I go to the admin blog posts page
  59. And I should see "You dont have permission to access that page!"
  60. Then I log in as admin
  61. And I go to the admin blog posts page
  62. Then The current url should be "/admin/posts"