return empty email if not current user
This commit is contained in:
@@ -5,7 +5,7 @@ module DiscoursePatrons
|
||||
skip_before_action :verify_authenticity_token, only: [:create]
|
||||
|
||||
def index
|
||||
result = {}
|
||||
result = { email: '' }
|
||||
|
||||
if current_user
|
||||
result[:email] = current_user.email
|
||||
|
||||
@@ -23,7 +23,7 @@ module DiscoursePatrons
|
||||
|
||||
it 'has no current user email' do
|
||||
get :index, format: :json
|
||||
expect(JSON.parse(response.body)['email']).to be_nil
|
||||
expect(JSON.parse(response.body)['email']).to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user