|
1 | 1 | Feature: The Hackety Blog |
2 | | - Scenario: I can see the blog |
3 | | - Given there is a blog post with the title "First Post" |
4 | | - When I go to the blog page |
5 | | - Then I should see "First Post" |
6 | | - Scenario: Admins may create a post |
7 | | - Given I'm logged in as admin |
8 | | - And I go to the new post page |
9 | | - When I fill in "Title" with "new title" |
10 | | - And I fill in "Body" with "new body" |
11 | | - And I fill in "Slug" with "new_title" |
12 | | - And I press "Create Post" |
13 | | - Then I should see "Post Created" |
14 | | - And I should see "new title" |
15 | | - And I should see "new body" |
16 | | - Scenario: I can view all posts |
17 | | - Given there is a blog post with the title "First Post" |
18 | | - And there is a blog post with the title "Second Post" |
19 | | - When I go to the posts page |
20 | | - Then I should see "First Post" |
21 | | - And I should see "Second Post" |
22 | | - Scenario: Not logged in users cannot create a post |
23 | | - Given I'm not logged in |
24 | | - And I go to the new post page |
25 | | - Then I should see "Sorry, buddy" |
26 | | - Scenario: Non-admin users cannot create a post |
27 | | - Given I'm logged in |
28 | | - And I go to the new post page |
29 | | - Then I should see "Sorry, buddy" |
30 | | - Scenario: Admins may edit a post |
31 | | - Given I'm logged in as admin |
32 | | - And there is a blog post with the title "First Post" |
33 | | - And I go to the edit post page for the post with the title "First Post" |
34 | | - And I fill in "Title" with "new title" |
35 | | - And I fill in "Slug" with "new_title" |
36 | | - And I fill in "Body" with "new body" |
37 | | - When I press "Modify Post" |
38 | | - Then I should see "Post Modified" |
39 | | - And I am on the post page for the post with the title "new title" |
40 | | - And I should see "new title" |
41 | | - And I should see "new body" |
42 | | - Scenario: Not logged in users cannot edit a post |
43 | | - Given I'm not logged in |
44 | | - And there is a blog post with the title "First Post" |
45 | | - And I go to the edit post page for the post with the title "First Post" |
46 | | - Then I should see "Sorry, buddy" |
47 | | - Scenario: Non-admin users cannot edit a post |
48 | | - Given I'm logged in |
49 | | - And there is a blog post with the title "First Post" |
50 | | - And I go to the edit post page for the post with the title "First Post" |
51 | | - Then I should see "Sorry, buddy" |
52 | | - Scenario: Logged in Users can comment on the blog |
53 | | - Given I'm logged in as "steve" |
54 | | - And there is a blog post |
55 | | - When I go to a blog post page |
56 | | - And I fill in "Submit your opinion:" with "This post is amazing!" |
57 | | - And I press "Submit" |
58 | | - Then I should be on a blog post page |
59 | | - And I should see "Thanks for your comment!" |
60 | | - And I should see "steve says:" |
61 | | - And I should see "This post is amazing!" |
62 | | - Scenario: Logged out users can't comment on the blog |
63 | | - Given I'm not logged in |
64 | | - And there is a blog post |
65 | | - When I go to a blog post page |
66 | | - Then should not see "Submit your opinion:" |
67 | | - And I should not see "Submit" |
68 | | - Scenario: Blog should use Markdown |
69 | | - Given I'm logged in as admin |
70 | | - And I go to the new post page |
71 | | - When I fill in "Title" with "new title" |
72 | | - And I fill in "Slug" with "new_title" |
73 | | - And I fill in "Body" with "new body with a link: [google](http://google.com/)" |
74 | | - And I press "Create Post" |
75 | | - Then I should see "Post Created" |
76 | | - And I should see "new title" |
77 | | - And I should see "google" within "//a" |
| 2 | + Scenario: I can see the blog |
| 3 | + Given there is a blog post with the title "First Post" |
| 4 | + When I go to the blog page |
| 5 | + Then I should see "First Post" |
| 6 | + Scenario: Admins may create a post |
| 7 | + Given I'm logged in as admin |
| 8 | + And I go to the new post page |
| 9 | + When I fill in "Title" with "new title" |
| 10 | + And I fill in "Body" with "new body" |
| 11 | + And I fill in "Slug" with "new_title" |
| 12 | + And I press "Create Post" |
| 13 | + Then I should see "Post Created" |
| 14 | + And I should see "new title" |
| 15 | + And I should see "new body" |
| 16 | + Scenario: I can view all posts |
| 17 | + Given there is a blog post with the title "First Post" |
| 18 | + And there is a blog post with the title "Second Post" |
| 19 | + When I go to the posts page |
| 20 | + Then I should see "First Post" |
| 21 | + And I should see "Second Post" |
| 22 | + Scenario: Not logged in users cannot create a post |
| 23 | + Given I'm not logged in |
| 24 | + And I go to the new post page |
| 25 | + Then I should see "Sorry, buddy" |
| 26 | + Scenario: Non-admin users cannot create a post |
| 27 | + Given I'm logged in |
| 28 | + And I go to the new post page |
| 29 | + Then I should see "Sorry, buddy" |
| 30 | + Scenario: Admins may edit a post |
| 31 | + Given I'm logged in as admin |
| 32 | + And there is a blog post with the title "First Post" |
| 33 | + And I go to the edit post page for the post with the title "First Post" |
| 34 | + And I fill in "Title" with "new title" |
| 35 | + And I fill in "Slug" with "new_title" |
| 36 | + And I fill in "Body" with "new body" |
| 37 | + When I press "Modify Post" |
| 38 | + Then I should see "Post Modified" |
| 39 | + And I am on the post page for the post with the title "new title" |
| 40 | + And I should see "new title" |
| 41 | + And I should see "new body" |
| 42 | + Scenario: Not logged in users cannot edit a post |
| 43 | + Given I'm not logged in |
| 44 | + And there is a blog post with the title "First Post" |
| 45 | + And I go to the edit post page for the post with the title "First Post" |
| 46 | + Then I should see "Sorry, buddy" |
| 47 | + Scenario: Non-admin users cannot edit a post |
| 48 | + Given I'm logged in |
| 49 | + And there is a blog post with the title "First Post" |
| 50 | + And I go to the edit post page for the post with the title "First Post" |
| 51 | + Then I should see "Sorry, buddy" |
| 52 | + Scenario: Logged in Users can comment on the blog |
| 53 | + Given I'm logged in as "steve" |
| 54 | + And there is a blog post |
| 55 | + When I go to a blog post page |
| 56 | + And I fill in "Submit your opinion:" with "This post is amazing!" |
| 57 | + And I press "Submit" |
| 58 | + Then I should be on a blog post page |
| 59 | + And I should see "Thanks for your comment!" |
| 60 | + And I should see "steve says:" |
| 61 | + And I should see "This post is amazing!" |
| 62 | + Scenario: Logged out users can't comment on the blog |
| 63 | + Given I'm not logged in |
| 64 | + And there is a blog post |
| 65 | + When I go to a blog post page |
| 66 | + Then should not see "Submit your opinion:" |
| 67 | + And I should not see "Submit" |
| 68 | + Scenario: Blog should use Markdown |
| 69 | + Given I'm logged in as admin |
| 70 | + And I go to the new post page |
| 71 | + When I fill in "Title" with "new title" |
| 72 | + And I fill in "Slug" with "new_title" |
| 73 | + And I fill in "Body" with "new body with a link: [google](http://google.com/)" |
| 74 | + And I press "Create Post" |
| 75 | + Then I should see "Post Created" |
| 76 | + And I should see "new title" |
| 77 | + And I should see "google" within "//a" |
0 commit comments