Skip to content

Commit 488e4d0

Browse files
committed
include unconfirmed email addresses in user search
test plan: - enable new user search - create a user but don't confirm their email right away - ensure the user can be found by account search by email address fixes CNVS-33430 Change-Id: I9c61e8389ee6e10d5bd133cb23ab74567e1e24ff Reviewed-on: https://gerrit.instructure.com/95730 Tested-by: Jenkins Reviewed-by: Steven Burnett <sburnett@instructure.com> QA-Review: Heath Hales <hhales@instructure.com> Product-Review: Jeremy Stanley <jeremy@instructure.com>
1 parent 2cb8db1 commit 488e4d0

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

lib/user_search.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def self.complex_sql
107107
WHERE communication_channels.user_id = users.id
108108
AND communication_channels.path_type = ?
109109
AND #{like_condition('communication_channels.path')}
110-
AND communication_channels.workflow_state='active'))
110+
AND communication_channels.workflow_state in ('active', 'unconfirmed')))
111111
SQL
112112
end
113113

spec/lib/user_search_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,11 @@
187187
cc.retire!
188188
expect(UserSearch.for_user_in_context("the.giver", course, user)).to eq []
189189
end
190+
191+
it 'matches unconfirmed channels' do
192+
cc2 = user.communication_channels.create!(path: 'unconfirmed@example.com')
193+
expect(UserSearch.for_user_in_context("unconfirmed", course, user)).to eq [user]
194+
end
190195
end
191196

192197
describe 'searching by a DB ID' do

0 commit comments

Comments
 (0)