Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_block
2
Feature: Allowed blocks controls
3
  In order to prevent the use of some blocks
4
  As an admin
5
  I need to restrict some blocks to be used in courses
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email |
10
      | teacher1 | Teacher | 1 | teacher1@example.com |
11
    And the following "courses" exist:
12
      | fullname | shortname | category |
13
      | Course 1 | C1 | 0 |
14
    And the following "course enrolments" exist:
15
      | user | course | role |
16
      | teacher1 | C1 | editingteacher |
17
 
18
  Scenario: Blocks can be added with the default permissions
19
    Given I log in as "teacher1"
20
    And I am on "Course 1" course homepage with editing mode on
21
    When I add the "Course completion status" block
22
    And I add the "Activities" block
23
    Then I should see "Activities" in the "Activities" "block"
24
    And I should see "Course completion status" in the "Course completion status" "block"
25
 
26
  Scenario: Blocks can not be added when the admin restricts the permissions
27
    Given the following "role capability" exists:
28
      | role                               | editingteacher  |
29
      | block/activity_modules:addinstance | prohibit        |
30
    And I log in as "admin"
31
    And I am on the "Course 1" "permissions" page
32
    And I override the system permissions of "Teacher" role with:
33
      | block/completionstatus:addinstance | Prohibit |
34
    And I log out
35
    When I log in as "teacher1"
36
    And I am on "Course 1" course homepage with editing mode on
37
    Then the add block selector should not contain "Activities" block
38
    And the add block selector should not contain "Course completion status" block