1 |
efrain |
1 |
@core @core_blog
|
|
|
2 |
Feature: 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 |
|
|
|
11 |
And the following "core_blog > entries" exist:
|
|
|
12 |
| subject | body | user |
|
|
|
13 |
| Blog post one | User 1 blog post content | testuser |
|
|
|
14 |
| Blog post two | User 1 blog post content | testuser |
|
|
|
15 |
And I log in as "admin"
|
|
|
16 |
And I am on site homepage
|
|
|
17 |
And I turn editing mode on
|
|
|
18 |
And the following config values are set as admin:
|
|
|
19 |
| unaddableblocks | | theme_boost|
|
|
|
20 |
# TODO MDL-57120 "Site blogs" link not accessible without navigation block.
|
|
|
21 |
And I add the "Navigation" block if not present
|
|
|
22 |
And I configure the "Navigation" block
|
|
|
23 |
And I set the following fields to these values:
|
|
|
24 |
| Page contexts | Display throughout the entire site |
|
|
|
25 |
And I press "Save changes"
|
|
|
26 |
And I log out
|
|
|
27 |
And I log in as "testuser"
|
|
|
28 |
And I am on site homepage
|
|
|
29 |
And I click on "Site blogs" "link" in the "Navigation" "block"
|
|
|
30 |
|
|
|
31 |
Scenario: Delete blog post results in post deleted
|
|
|
32 |
Given I follow "Blog post one"
|
|
|
33 |
And I follow "Delete"
|
|
|
34 |
And I should see "Delete the blog entry 'Blog post one'?"
|
|
|
35 |
When I press "Continue"
|
|
|
36 |
Then I should not see "Blog post one"
|
|
|
37 |
And I should see "Blog post two"
|
|
|
38 |
|
|
|
39 |
Scenario: Delete confirmation screen works and allows cancel
|
|
|
40 |
Given I follow "Blog post one"
|
|
|
41 |
When I follow "Delete"
|
|
|
42 |
Then I should see "Delete the blog entry 'Blog post one'?"
|
|
|
43 |
And I press "Cancel"
|
|
|
44 |
And I should see "Blog post one"
|
|
|
45 |
And I should see "Blog post two"
|