return empty email if not current user
This commit is contained in:
parent
63ea563553
commit
7f7bd52552
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue