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

blog.feature 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. Feature: Manage Articles
  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. @focus
  11. Scenario: Blog posts list
  12. When I go to the blog page
  13. Then I should see "Hello World"
  14. And I should see "First Post"
  15. And I should see "Test 001"
  16. And I should see "Testing the website"
  17. Scenario: Blog post page
  18. When I go to the blog page
  19. And I click in the link "Hello World"
  20. Then I should see "Hello World"
  21. And I should see "Welcome to the website"
  22. And The current url should be "/blog/hello_world"
  23. Scenario: New blog post
  24. Given I am logged in as admin
  25. Then I click in the link "Admin Panel"
  26. And I click in the link "Posts"
  27. And The current url should be "/admin/posts"
  28. Then I click in the link "New Post"
  29. And The current url should be "/admin/posts/new"
  30. Then I fill in "Title" with "Test 002"
  31. And I fill in "Slug" with "test_002"
  32. And I fill in "Description" with "Another blog post test"
  33. And I fill in "post_content" with "This is blog post test number 002!"
  34. And I click in the button "Save"
  35. Then I should see "Test 002"
  36. And I should see "This is blog post test number 002!"
  37. And I should see "Admin"
  38. Scenario: Delete blog post
  39. Given I am logged in as admin
  40. Then I click in the link "Admin Panel"
  41. Then I click in the link "Posts"
  42. And The current url should be "/admin/posts"
  43. Then I should see "Hello World"
  44. And I should see "Test 001"
  45. Then I click in the link "delete_hello_world"
  46. Then I should see "Test 001"
  47. And I should not see "Hello World"
  48. Scenario: Only admin users can see edit blog post button
  49. Given I go to the blog page
  50. And I click in the link "Hello World"
  51. Then I should not see the link "edit_hello_world"
  52. Then I log in as admin
  53. And I go to the blog page
  54. And I click in the link "Hello World"
  55. Then I should see the link "edit_hello_world"
  56. Scenario: Only admin users can access the blog posts admin page
  57. Given I go to the blog page
  58. Then I should not see the link "navlink_admin_panel"
  59. Then I go to the admin blog posts page
  60. And I should see "You dont have permission to access that page!"
  61. Then I log in as admin
  62. And I go to the admin blog posts page
  63. Then The current url should be "/admin/posts"