Skip to content

Commit

Permalink
MDL-50330 blog: Behat test for blog visibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
abgreeve committed May 22, 2015
1 parent 0c71316 commit c2c5f87
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions blog/tests/behat/blog_visibility.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
@core @core_blog
Feature: Blogs can be set to be only visible by the author.
In order to make blogs personal only
As a user
I need to set the blog level to Users can only see their own blogs.

Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| testuser | Test | User | moodle@example.com |
| testuser2 | Test2 | User2 | moodle2@example.com |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| testuser | C1 | student |
| testuser2 | C1 | student |
And I log in as "admin"
And I am on site homepage
And I navigate to "Blog" node in "Site administration > Appearance"
And I set the following fields to these values:
| Blog visibility | Users can only see their own blog |
And I press "Save changes"
And I log out

@javascript
Scenario: A student can not see another student's blog entries.
Given I log in as "testuser"
And I follow "Course 1"
And I follow "Participants"
And I follow "Test2 User2"
And I should see "Miscellaneous"
Then I should not see "Blog entries"
And I follow "Profile" in the user menu
And I follow "Blog entries"
And I should see "User blog: Test User"

0 comments on commit c2c5f87

Please sign in to comment.