mirrored from git://git.moodle.org/moodle.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'MDL-45268-26' of git://github.com/danpoltawski/moodle i…
…nto MOODLE_26_STABLE
- Loading branch information
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
blocks/participants/tests/behat/block_participants_course.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
@block @block_participants | ||
Feature: People Block used in a course | ||
In order to view participants in a course | ||
As a teacher | ||
I can add the people block to a course | ||
|
||
Background: | ||
Given the following "courses" exist: | ||
| fullname | shortname | category | | ||
| Course 1 | C101 | 0 | | ||
And the following "users" exist: | ||
| username | firstname | lastname | email | | ||
| student1 | Sam | Student | student1@asd.com | | ||
And the following "course enrolments" exist: | ||
| user | course | role | | ||
| student1 | C101 | student | | ||
And I log in as "admin" | ||
And I follow "Course 1" | ||
And I turn editing mode on | ||
And I add the "People" block | ||
And I log out | ||
|
||
Scenario: Student can view participants link | ||
When I log in as "student1" | ||
And I follow "Course 1" | ||
Then "People" "block" should exist | ||
And I should see "Participants" in the "People" "block" | ||
|
||
Scenario: Student can follow participants link and be directed to the correct page | ||
When I log in as "student1" | ||
And I follow "Course 1" | ||
And I click on "Participants" "link" in the "People" "block" | ||
Then I should see "All participants" in the "h3" "css_element" | ||
And the "My courses" select box should contain "C101" | ||
|
||
Scenario: Student without permission can not view participants link | ||
Given the following "permission overrides" exist: | ||
| capability | permission | role | contextlevel | reference | | ||
| moodle/course:viewparticipants | Prevent | student | Course | C101 | | ||
When I log in as "student1" | ||
And I follow "Course 1" | ||
Then "People" "block" should not exist |
23 changes: 23 additions & 0 deletions
23
blocks/participants/tests/behat/block_participants_frontpage.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@block @block_participants | ||
Feature: People Block used on frontpage | ||
In order to view participants in a site | ||
As a admin | ||
I can add the people block to the front page | ||
|
||
Background: | ||
Given the following "users" exist: | ||
| username | firstname | lastname | email | | ||
| student1 | Sam | Student | student1@asd.com | | ||
And I log in as "admin" | ||
And I follow "Turn editing on" | ||
And I add the "People" block | ||
And I log out | ||
|
||
Scenario: Admin can view site participants link | ||
When I log in as "admin" | ||
Then "People" "block" should exist | ||
And I should see "Participants" in the "People" "block" | ||
|
||
Scenario: Student can not follow participants link on frontpage | ||
When I log in as "student1" | ||
Then "People" "block" should not exist |