Commit c8ed0816 authored by Aaron Wells's avatar Aaron Wells Committed by Gerrit Code Review

Merge changes I6b01fec8,Ibf22f361

* changes:
  Behat Test: Friend Request (Bug 1440908)
  The accepting friend notification contains full url (Bug #1440908)
parents 1d649f21 e01e1038
......@@ -198,6 +198,7 @@ function activitylistin_html($type='all', $limit=10, $offset=0) {
$record->message = format_notification_whitespace($record->message);
// used to identify notification as internal for json-calls
$record->table = 'notification_internal_activity';
$record->url = preg_replace('|^' . get_config('wwwroot') . '|', '', $record->url); // Remove the wwwroot form url as it will ba added again in template
$records[] = $record;
// messages from plugin
}
......
......@@ -2143,7 +2143,7 @@ function acceptfriend_submit(Pieform $form, $values) {
// notification info
$n = new StdClass;
$n->url = profile_url($USER);
$n->url = profile_url($USER, false);
$n->users = array($user->id);
$n->fromuser = $USER->get('id');
$lang = get_user_language($user->id);
......
@javascript @core @core_account
Feature: Sending friend requests
In order to send a friend request and be directed to the right page
As an admin/user
So I can be friends with other users
Background:
Given the following "users" exist:
| username | password | email | firstname | lastname | institution | authname | role |
| userA | Password1 | test01@example.com | Pete | Mc | mahara | internal | member |
Scenario: Sending friend requests from student to admin (Bug 1440908)
Given I log in as "admin" with password "Password1"
And I follow "Administration"
And I choose "User search" in "Users"
And I follow "Pete Mc"
And I follow "Log in as userA"
And I follow "Admin User"
And I follow "Request friendship"
And I fill in "Would you like to be my friend?" for "Message"
And I press "Request friendship"
And I follow "Become Admin User again"
And I am on homepage
And I follow "New friend request"
And I follow "Requests"
And I press "Approve request"
And I should see "Accepted friend request"
And I follow "Log in as userA"
And I follow "Friend request accepted"
And I follow "More..."
And I should not see "Not Found"
And I should see "Remove from friends"
And I should see "Admin User's wall"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment