Send user agent in email
This commit is contained in:
parent
c31ae88231
commit
43041881a9
|
@ -8,6 +8,9 @@
|
|||
|
||||
<dt><strong><%= Session.human_attribute_name :ip_address %>:</strong></dt>
|
||||
<dd><%= @session.ip_address %></dd>
|
||||
|
||||
<dt><strong><%= Session.human_attribute_name :user_agent %>:</strong></dt>
|
||||
<dd><%= truncate @session.user_agent, length: 100 %></dd>
|
||||
</dl>
|
||||
|
||||
<p>
|
||||
|
|
|
@ -17,16 +17,20 @@ RSpec.describe NotificationMailer do
|
|||
|
||||
it 'includes greeting' do
|
||||
expect(mail.body.encoded).to \
|
||||
match "Здравствуйте, #{session.account.public_name}"
|
||||
include "Здравствуйте, #{session.account.public_name}"
|
||||
end
|
||||
|
||||
it 'includes datetime' do
|
||||
expect(mail.body.encoded).to \
|
||||
match I18n.localize session.logged_at, format: :long
|
||||
include I18n.localize session.logged_at, format: :long
|
||||
end
|
||||
|
||||
it 'includes IP address' do
|
||||
expect(mail.body.encoded).to match session.ip_address
|
||||
expect(mail.body.encoded).to include session.ip_address
|
||||
end
|
||||
|
||||
it 'inclused user agent' do
|
||||
expect(mail.body.encoded).to include session.user_agent[0...90]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Reference in New Issue