-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5643 from dodona-edu/feat/filter-users-by-email
Allow filtering users by email
- Loading branch information
Showing
2 changed files
with
11 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1223,4 +1223,14 @@ def setup | |
|
||
assert_not user.reload.open_questions? | ||
end | ||
|
||
test 'should be able to search by email' do | ||
first = create :user, email: '[email protected]' | ||
second = create :user, email: '[email protected]' | ||
|
||
assert_equal first, User.by_filter('[email protected]').first | ||
assert_equal second, User.by_filter('ax.com').first | ||
assert_empty User.by_filter('baz') | ||
assert_equal 2, User.by_filter('foo@ba').count | ||
end | ||
end |