Merge branch 'MDL-66226-master-2' of https://github.com/snake/moodle
[moodle.git] / blog / tests / behat / delete.feature
CommitLineData
3e0f5665
DP
1@core @core_blog
2Feature: Delete a blog entry
3 In order to manage my blog entries
4 As a user
5 I need to be able to delete entries I no longer wish to appear
6
7 Background:
8 Given the following "users" exist:
9 | username | firstname | lastname | email |
10 | testuser | Test | User | moodle@example.com |
7a12a02d
MG
11 And I log in as "admin"
12 And I am on site homepage
13 And I turn editing mode on
14 # TODO MDL-57120 "Site blogs" link not accessible without navigation block.
15 And I add the "Navigation" block if not present
16 And I configure the "Navigation" block
17 And I set the following fields to these values:
18 | Page contexts | Display throughout the entire site |
19 And I press "Save changes"
20 And I log out
3e0f5665 21 And I log in as "testuser"
02fda279 22 And I click on "Site blogs" "link" in the "Navigation" "block"
3e0f5665
DP
23 And I follow "Add a new entry"
24 And I set the following fields to these values:
25 | Entry title | Blog post one |
26 | Blog entry body | User 1 blog post content |
27 And I press "Save changes"
28 And I follow "Add a new entry"
29 And I set the following fields to these values:
30 | Entry title | Blog post two |
31 | Blog entry body | User 1 blog post content |
32 And I press "Save changes"
33 And I am on site homepage
02fda279 34 And I click on "Site blogs" "link" in the "Navigation" "block"
3e0f5665
DP
35
36 Scenario: Delete blog post results in post deleted
37 Given I follow "Blog post one"
38 And I follow "Delete"
39 And I should see "Delete the blog entry 'Blog post one'?"
40 When I press "Continue"
41 Then I should not see "Blog post one"
42 And I should see "Blog post two"
43
44 Scenario: Delete confirmation screen works and allows cancel
45 Given I follow "Blog post one"
46 When I follow "Delete"
47 Then I should see "Delete the blog entry 'Blog post one'?"
48 And I press "Cancel"
49 And I should see "Blog post one"
50 And I should see "Blog post two"