We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2efb197 commit bbd7870Copy full SHA for bbd7870
app/models/user.rb
@@ -98,7 +98,7 @@ def hash_for_email(email)
98
end
99
100
def nickname_from_email(email)
101
- hash_for_email(email)
+ hash_for_email(email) if email.present?
102
103
104
def hide_nickname?
spec/controllers/users_controller_spec.rb
@@ -26,6 +26,17 @@
26
get :show, params: { id: user_with_participations.id }
27
expect(response).to be_ok
28
29
+
30
+ context 'when user has no email' do
31
+ render_views
32
33
+ before { user.update!(email: nil) }
34
35
+ it 'does not fail' do
36
+ get :show, params: { id: user.id }
37
+ expect(response).to be_ok
38
+ end
39
40
41
42
context 'GET :edit' do
0 commit comments