Commit 9e1f25cd577d8d84e6e9fbed02a69a037f0c4141
Exists in
master
and in
1 other branch
Merge pull request #531 from brendonrapp/master
Nicer, friendlier HipChat notification message
Showing
3 changed files
with
5 additions
and
4 deletions
Show diff stats
app/models/notification_services/hipchat_service.rb
... | ... | @@ -24,8 +24,9 @@ if defined? HipChat |
24 | 24 | def create_notification(problem) |
25 | 25 | url = app_problem_url problem.app, problem |
26 | 26 | message = <<-MSG.strip_heredoc |
27 | - [#{ERB::Util.html_escape problem.app.name}]#{ERB::Util.html_escape notification_description(problem)}<br> | |
28 | - <a href="#{url}">#{url}</a> | |
27 | + <strong>#{ERB::Util.html_escape problem.app.name}</strong> error in <strong>#{ERB::Util.html_escape problem.environment}</strong> at <strong>#{ERB::Util.html_escape problem.where}</strong> (<a href="#{url}">details</a>)<br> | |
28 | + #{ERB::Util.html_escape problem.message.to_s.truncate(100)}<br> | |
29 | + Times occurred: #{problem.notices_count} | |
29 | 30 | MSG |
30 | 31 | |
31 | 32 | client = HipChat::Client.new(api_token) | ... | ... |
app/views/apps/index.html.haml
spec/models/notification_service/hipchat_service_spec.rb
... | ... | @@ -15,7 +15,7 @@ describe NotificationServices::HipchatService do |
15 | 15 | end |
16 | 16 | |
17 | 17 | it 'escapes html in message' do |
18 | - service.stub(:notification_description => '<3') | |
18 | + problem.stub(:message => '<3') | |
19 | 19 | room.should_receive(:send) do |_, message| |
20 | 20 | message.should_not include('<3') |
21 | 21 | message.should include('<3') | ... | ... |