From c246015a5843e50ddc55031b2d884d58b6d26080 Mon Sep 17 00:00:00 2001 From: David Monllao Date: Mon, 8 Apr 2013 10:06:47 +0800 Subject: [PATCH] MDL-38954 behat: New test According to MDLQA-133, a user can not send messages to someone who has blocked him. --- message/tests/behat/block_users.feature | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 message/tests/behat/block_users.feature diff --git a/message/tests/behat/block_users.feature b/message/tests/behat/block_users.feature new file mode 100644 index 00000000000..cf6120bd6ba --- /dev/null +++ b/message/tests/behat/block_users.feature @@ -0,0 +1,29 @@ +@core_message +Feature: Block users from contacting me + In order to block other users + As a moodle user + I need to prevent specific users to sending me messages + + @javascript + Scenario: Block users from contacting me with Javascript enabled + Given the following "users" exists: + | username | firstname | lastname | email | + | user1 | User | One | one@asd.com | + | user2 | User | Two | two@asd.com | + And I log in as "user1" + And I expand "My profile" node + And I follow "Messages" + And I fill in "Search people and messages" with "User Two" + And I press "Search people and messages" + When I click on "Block contact" "link" in the "User Two" table row + Then the "Message navigation:" select box should contain "Blocked users (1)" + And I select "Blocked users (1)" from "Message navigation:" + And I should see "User Two" + And I log out + And I log in as "user2" + And I expand "My profile" node + And I follow "Messages" + And I fill in "Search people and messages" with "User One" + And I press "Search people and messages" + And I follow "Send message to User One" + And I should see "This user has blocked you from sending messages to them" -- 2.11.4.GIT