[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/mod/forum/tests/behat/ -> separate_group_discussions.feature (source)

   1  @mod @mod_forum
   2  Feature: Posting to all groups in a separate group discussion is restricted to users with access to all groups
   3    In order to post to all groups in a forum with separate groups
   4    As a teacher
   5    I need to have the accessallgroups capability or be a member of all of the groups
   6  
   7    Background:
   8      Given the following "users" exist:
   9        | username | firstname | lastname | email |
  10        | teacher1 | Teacher | 1 | [email protected] |
  11        | noneditor1 | Non-editing teacher | 1 | [email protected] |
  12        | noneditor2 | Non-editing teacher | 2 | [email protected] |
  13        | student1 | Student | 1 | [email protected] |
  14      And the following "courses" exist:
  15        | fullname | shortname | category |
  16        | Course 1 | C1 | 0 |
  17      And the following "course enrolments" exist:
  18        | user | course | role |
  19        | teacher1 | C1 | editingteacher |
  20        | noneditor1 | C1 | teacher |
  21        | noneditor2 | C1 | teacher |
  22        | student1 | C1 | student |
  23      And the following "groups" exist:
  24        | name | course | idnumber |
  25        | Group A | C1 | G1 |
  26        | Group B | C1 | G2 |
  27        | Group C | C1 | G3 |
  28      And the following "group members" exist:
  29        | user | group |
  30        | teacher1 | G1 |
  31        | teacher1 | G2 |
  32        | noneditor1 | G1 |
  33        | noneditor1 | G2 |
  34        | noneditor1 | G3 |
  35        | noneditor2 | G1 |
  36        | noneditor2 | G2 |
  37        | student1 | G1 |
  38        | student1 | G2 |
  39      And I log in as "teacher1"
  40      And I follow "Course 1"
  41      And I turn editing mode on
  42      And I add a "Forum" to section "1" and I fill the form with:
  43        | Forum name | Standard forum name |
  44        | Forum type | Standard forum for general use |
  45        | Description | Standard forum description |
  46        | Group mode | Separate groups |
  47      And I log out
  48  
  49    Scenario: Teacher with accessallgroups can post in all groups
  50      Given I log in as "teacher1"
  51      And I follow "Course 1"
  52      And I follow "Standard forum name"
  53      When I click on "Add a new discussion topic" "button"
  54      Then the "Group" select box should contain "All participants"
  55      And the "Group" select box should contain "Group A"
  56      And the "Group" select box should contain "Group B"
  57  
  58    @javascript
  59    Scenario: Teacher in all groups but without accessallgroups can only post in their groups
  60      And I log in as "admin"
  61      And I set the following system permissions of "Non-editing teacher" role:
  62        | moodle/site:accessallgroups | Prohibit |
  63      And I log out
  64      Given I log in as "noneditor1"
  65      And I follow "Course 1"
  66      And I follow "Standard forum name"
  67      When I click on "Add a new discussion topic" "button"
  68      Then the "Group" select box should not contain "All participants"
  69      And the "Group" select box should contain "Group A"
  70      And the "Group" select box should contain "Group B"
  71  
  72    @javascript
  73    Scenario: Teacher in some groups and without accessallgroups can only post in their groups
  74      And I log in as "admin"
  75      And I set the following system permissions of "Non-editing teacher" role:
  76        | moodle/site:accessallgroups | Prohibit |
  77      And I log out
  78      Given I log in as "noneditor1"
  79      And I follow "Course 1"
  80      And I follow "Standard forum name"
  81      When I click on "Add a new discussion topic" "button"
  82      Then the "Group" select box should not contain "All participants"
  83      And the "Group" select box should contain "Group A"
  84      And the "Group" select box should contain "Group B"


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1