Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
cfb3d2fb
Commit
cfb3d2fb
authored
Mar 15, 2016
by
Aaron Wells
Committed by
Robert Lyon
Mar 22, 2016
Browse files
Bug 1530494: Restoring institution filter to "find friends" page
Change-Id: I71c3afc2b3a4e07f4bbba1bb356d86911ab4b332
parent
98d516d9
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/user/find.php
View file @
cfb3d2fb
...
...
@@ -66,9 +66,11 @@ $searchform = array(
);
if
(
$USER
->
get
(
'institutions'
))
{
$searchform
[
'filter'
]
=
array
(
$searchform
[
'
elements'
][
'
filter'
]
=
array
(
'type'
=>
'select'
,
'defaultvalue'
=>
$filter
,
'title'
=>
get_string
(
'filter'
),
'hiddenlabel'
=>
true
,
'options'
=>
array
(
'all'
=>
get_string
(
'Everyone'
,
'group'
),
'myinstitutions'
=>
get_string
(
'myinstitutions'
,
'group'
),
...
...
@@ -78,6 +80,8 @@ if ($USER->get('institutions')) {
$searchform
[
'elements'
][
'inputgroup'
][
'elements'
][
'query'
]
=
array
(
'type'
=>
'text'
,
'title'
=>
get_string
(
'search'
),
'hiddenlabel'
=>
true
,
'defaultvalue'
=>
$query
,
);
$searchform
[
'elements'
][
'inputgroup'
][
'elements'
][
'submit'
]
=
array
(
...
...
test/behat/features/user/find_friend.feature
0 → 100644
View file @
cfb3d2fb
@javascript
@core
@core_user
@core_portfolio
@friends
Feature
:
Searching for users in the "Find friends" page
In order to search by name on the "Find friends" page
So I can befriend them or send them messages
Background
:
Given the following "institutions" exist
:
|
name
|
displayname
|
|
one
|
Institution
1
|
|
two
|
Institution
2
|
Given the following "users" exist
:
|
username
|
password
|
email
|
firstname
|
lastname
|
institution
|
authname
|
role
|
|
bob
|
mahara1
|
bob@example.com
|
Bob
|
Smith
|
one
|
internal
|
member
|
|
jen
|
mahara1
|
jen@example.com
|
Jen
|
Smith
|
one
|
internal
|
member
|
|
aaron
|
mahara1
|
aaron@example.com
|
Aaron
|
Smith
|
two
|
internal
|
member
|
Scenario
:
Find users in your institution and outside your institution
# Log in as a user
Given
I log in as
"bob"
with password
"mahara1"
And
I choose
"Find friends"
in
"Groups"
And
I wait
"1"
seconds
# Searching within my own institution, I should only find users in my institution
And
I select
"My institutions"
from
"Filter"
And
I set the field
"Search"
to
"smith"
And
I scroll to the id
"main-nav"
And
I press
"Search"
Then
I should see
"Jen Smith"
And
I should not see
"Aaron Smith"
# Searching outside my own institution, I should find all users
When
I select
"Everyone"
from
"Filter"
And
I set the field
"Search"
to
"smith"
And
I press
"search_submit"
# I should find everyone
Then
I should see
"Jen Smith"
And
I should see
"Aaron Smith"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment