Merge branch 'MDL-68633' of git://github.com/paulholden/moodle
authorSara Arjona <sara@moodle.com>
Wed, 25 Aug 2021 14:11:03 +0000 (16:11 +0200)
committerSara Arjona <sara@moodle.com>
Wed, 25 Aug 2021 14:12:38 +0000 (16:12 +0200)
1  2 
mod/forum/tests/behat/forum_subscriptions_management.feature

@@@ -49,3 -49,27 +49,25 @@@ Feature: A teacher can control the subs
      And I press "Finish managing subscriptions"
      And ".userselector" "css_element" should not exist
      And "Manage subscribers" "button" should exist
 -    When I log in as "teacher"
 -    And I am on "Course 1" course homepage
 -    And I follow "Test forum"
+   @javascript
+   Scenario Outline: Toggle forum subscription mode via settings navigation
+     Given the following "activity" exists:
+       | course         | C1            |
+       | activity       | forum         |
+       | name           | Test forum    |
+       | idnumber       | F1            |
+       | type           | general       |
+       | forcesubscribe | <initialmode> |
++    When I am on the "Test forum" "forum activity" page logged in as "teacher"
+     And I open the action menu in "#region-main-box" "css_element"
+     And I choose "<updatedmode>" in the open action menu
+     And I should see "Are you sure you want to change the subscription mode to \"<updatedmode>\"" in the "Confirmation" "dialogue"
+     And I click on "Yes" "button" in the "Confirmation" "dialogue"
+     Then I should see "<updatedmodeconfirmed>"
+     Examples:
+       | initialmode | updatedmode           | updatedmodeconfirmed                     |
+       | 1           | Optional subscription | Everyone can now choose to be subscribed |
+       | 0           | Forced subscription   | Everyone is now subscribed to this forum |
+       | 0           | Auto subscription     | Everyone is now subscribed to this forum |
+       | 0           | Subscription disabled | Subscriptions are now disallowed         |