[fix #4529] Log user email in manager space

This commit is contained in:
simon lehericey 2019-11-18 23:11:38 +01:00
parent 63b1b49a68
commit dae7a3bfd0
3 changed files with 48 additions and 0 deletions

View file

@ -0,0 +1,22 @@
describe Manager::ApplicationController, type: :controller do
describe 'append_info_to_payload' do
let(:current_user) { create(:administration) }
let(:payload) { {} }
before do
allow(@controller).to receive(:current_user).and_return(current_user)
@controller.send(:append_info_to_payload, payload)
end
it do
[:db_runtime, :view_runtime, :variant, :rendered_format].each do |key|
payload.delete(key)
end
expect(payload).to eq({
user_agent: 'Rails Testing',
user_id: current_user.id,
user_email: current_user.email
})
end
end
end