Merge branch 'MDL-66226-master-2' of https://github.com/snake/moodle
[moodle.git] / blog / tests / behat / blog_visibility.feature
CommitLineData
c2c5f874
AG
1@core @core_blog
2Feature: Blogs can be set to be only visible by the author.
3 In order to make blogs personal only
4 As a user
5 I need to set the blog level to Users can only see their own blogs.
6
7 Background:
8 Given the following "users" exist:
9 | username | firstname | lastname | email |
10 | testuser | Test | User | moodle@example.com |
11 | testuser2 | Test2 | User2 | moodle2@example.com |
12 And the following "courses" exist:
13 | fullname | shortname |
14 | Course 1 | C1 |
15 And the following "course enrolments" exist:
16 | user | course | role |
17 | testuser | C1 | student |
18 | testuser2 | C1 | student |
19 And I log in as "admin"
20 And I am on site homepage
02fda279 21 And I navigate to "Appearance > Blog" in site administration
c2c5f874
AG
22 And I set the following fields to these values:
23 | Blog visibility | Users can only see their own blog |
24 And I press "Save changes"
25 And I log out
26
c2c5f874
AG
27 Scenario: A student can not see another student's blog entries.
28 Given I log in as "testuser"
fdeeaff9 29 And I am on "Course 1" course homepage
e5287f9b 30 And I navigate to course participants
c2c5f874
AG
31 And I follow "Test2 User2"
32 And I should see "Miscellaneous"
33 Then I should not see "Blog entries"
34 And I follow "Profile" in the user menu
35 And I follow "Blog entries"
36 And I should see "User blog: Test User"