mirror of
https://github.com/moodle/moodle.git
synced 2025-03-22 08:30:04 +01:00
MDL-1626 mod_forum: Add behat tests for existing functionality
This commit is contained in:
parent
a7a849038a
commit
dc0464801d
91
mod/forum/tests/behat/forum_subscriptions.feature
Normal file
91
mod/forum/tests/behat/forum_subscriptions.feature
Normal file
@ -0,0 +1,91 @@
|
||||
@mod @mod_forum
|
||||
Feature: A user can control their own subscription preferences for a forum
|
||||
In order to receive notifications for things I am interested in
|
||||
As a user
|
||||
I need to choose my forum subscriptions
|
||||
|
||||
Background:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email |
|
||||
| student1 | Student | One | student.one@example.com |
|
||||
And the following "courses" exist:
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| student1 | C1 | student |
|
||||
And I log in as "admin"
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
|
||||
Scenario: A disallowed subscription forum cannot be subscribed to
|
||||
Given I add a "Forum" to section "1" and I fill the form with:
|
||||
| Forum name | Test forum name |
|
||||
| Forum type | Standard forum for general use |
|
||||
| Description | Test forum description |
|
||||
| Subscription mode | Subscription disabled |
|
||||
And I add a new discussion to "Test forum name" forum with:
|
||||
| Subject | Test post subject |
|
||||
| Message | Test post message |
|
||||
And I log out
|
||||
When I log in as "student1"
|
||||
And I follow "Course 1"
|
||||
And I follow "Test forum name"
|
||||
Then I should not see "Subscribe to this forum"
|
||||
And I should not see "Unsubscribe from this forum"
|
||||
|
||||
Scenario: A forced subscription forum cannot be subscribed to
|
||||
Given I add a "Forum" to section "1" and I fill the form with:
|
||||
| Forum name | Test forum name |
|
||||
| Forum type | Standard forum for general use |
|
||||
| Description | Test forum description |
|
||||
| Subscription mode | Forced subscription |
|
||||
And I add a new discussion to "Test forum name" forum with:
|
||||
| Subject | Test post subject |
|
||||
| Message | Test post message |
|
||||
And I log out
|
||||
When I log in as "student1"
|
||||
And I follow "Course 1"
|
||||
And I follow "Test forum name"
|
||||
Then I should not see "Subscribe to this forum"
|
||||
And I should not see "Unsubscribe from this forum"
|
||||
|
||||
Scenario: An optional forum can be subscribed to
|
||||
Given I add a "Forum" to section "1" and I fill the form with:
|
||||
| Forum name | Test forum name |
|
||||
| Forum type | Standard forum for general use |
|
||||
| Description | Test forum description |
|
||||
| Subscription mode | Optional subscription |
|
||||
And I add a new discussion to "Test forum name" forum with:
|
||||
| Subject | Test post subject |
|
||||
| Message | Test post message |
|
||||
And I log out
|
||||
When I log in as "student1"
|
||||
And I follow "Course 1"
|
||||
And I follow "Test forum name"
|
||||
Then I should see "Subscribe to this forum"
|
||||
And I should not see "Unsubscribe from this forum"
|
||||
And I follow "Subscribe to this forum"
|
||||
And I follow "Continue"
|
||||
And I should see "Unsubscribe from this forum"
|
||||
And I should not see "Subscribe to this forum"
|
||||
|
||||
Scenario: An Automatic forum can be unsubscribed from
|
||||
Given I add a "Forum" to section "1" and I fill the form with:
|
||||
| Forum name | Test forum name |
|
||||
| Forum type | Standard forum for general use |
|
||||
| Description | Test forum description |
|
||||
| Subscription mode | Auto subscription |
|
||||
And I add a new discussion to "Test forum name" forum with:
|
||||
| Subject | Test post subject |
|
||||
| Message | Test post message |
|
||||
And I log out
|
||||
When I log in as "student1"
|
||||
And I follow "Course 1"
|
||||
And I follow "Test forum name"
|
||||
Then I should see "Unsubscribe from this forum"
|
||||
And I should not see "Subscribe to this forum"
|
||||
And I follow "Unsubscribe from this forum"
|
||||
And I follow "Continue"
|
||||
And I should see "Subscribe to this forum"
|
||||
And I should not see "Unsubscribe from this forum"
|
Loading…
x
Reference in New Issue
Block a user