Commit 78c859f7d11aa22dc29e99049bd2ccdd7ce3305d

Authored by Edgars Beigarts
Committed by Stephen Crosby
1 parent 2f7e3926
Exists in master

Add icon for slack (#1076)

app/models/notification_services/slack_service.rb
... ... @@ -20,7 +20,7 @@ class NotificationServices::SlackService < NotificationService
20 20 def post_payload(problem)
21 21 {
22 22 username: "Errbit",
23   - icon_emoji: ":collision:",
  23 + icon_url: "https://raw.githubusercontent.com/errbit/errbit/master/docs/notifications/slack/errbit.png",
24 24 attachments: [
25 25 {
26 26 fallback: message_for_slack(problem),
... ...
docs/notifications/slack/errbit.png

4.73 KB | W: | H:

2.43 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
docs/notifications/slack/index.md
... ... @@ -14,8 +14,6 @@ Copy the Hook URL specified by the Slack service.
14 14  
15 15 ![Hook URL](hook_url.png)
16 16  
17   -Optionally change the name of the integration to "Errbit", and include the errbit logo for inline messages: ![Errbit](errbit.png)
18   -
19 17 ### Setup in Errbit
20 18  
21 19 On the App Edit Page, click to highlight the slack integration.
... ...
spec/models/notification_service/slack_service_spec.rb
... ... @@ -9,14 +9,18 @@ describe NotificationServices::SlackService, type: 'model' do
9 9 service_url: service_url
10 10 end
11 11  
12   - it "it should send a notification to Slack with hook url" do
  12 + it "should have icon for slack" do
  13 + expect(Rails.root.join("docs/notifications/slack/errbit.png")).to exist
  14 + end
  15 +
  16 + it "should send a notification to Slack with hook url" do
13 17 # setup
14 18 problem = notice.problem
15 19  
16 20 # faraday stubbing
17 21 payload = {
18 22 username: "Errbit",
19   - icon_emoji: ":collision:",
  23 + icon_url: "https://raw.githubusercontent.com/errbit/errbit/master/docs/notifications/slack/errbit.png",
20 24 attachments: [
21 25 {
22 26 fallback: service.message_for_slack(problem),
... ...