Commit 2b0d5900b28a2846b880f31d12a123193c5f9ec6

Authored by Raffael Schmid
1 parent d7dbe7f5
Exists in master and in 1 other branch production

replace faraday with httparty

Gemfile
... ... @@ -55,7 +55,7 @@ gem 'hoi'
55 55 # Pushover (iOS Push notifications)
56 56 gem 'rushover'
57 57 # Hubot
58   -gem 'faraday'
  58 +gem 'httparty'
59 59  
60 60 # Authentication
61 61 # ---------------------------------------
... ...
Gemfile.lock
... ... @@ -344,7 +344,6 @@ DEPENDENCIES
344 344 email_spec
345 345 execjs
346 346 fabrication (~> 1.3.0)
347   - faraday
348 347 foreman
349 348 gitlab!
350 349 haml
... ... @@ -352,6 +351,7 @@ DEPENDENCIES
352 351 hoi
353 352 hoptoad_notifier (~> 2.4)
354 353 htmlentities (~> 4.3.0)
  354 + httparty
355 355 inherited_resources
356 356 kaminari (>= 0.14.1)
357 357 launchy
... ...
app/models/notification_services/hubot_service.rb
... ... @@ -26,7 +26,7 @@ class NotificationServices::HubotService < NotificationService
26 26 end
27 27  
28 28 def create_notification(problem)
29   - Faraday.post(url, :message => message_for_hubot(problem), :room => room_id)
  29 + HTTParty.post(url, :body => {:message => message_for_hubot(problem), :room => room_id})
30 30 end
31 31 end
32 32  
... ...
spec/models/notification_service/hubot_service_spec.rb
... ... @@ -8,7 +8,7 @@ describe NotificationService::HubotService do
8 8 problem = notice.problem
9 9  
10 10 # faraday stubbing
11   - Faraday.should_receive(:post).with(notification_service.api_token, {:message => '[production][foo#bar] FooError: Too Much Bar', :room => notification_service.room_id}).and_return(true)
  11 + HTTParty.should_receive(:post).with(notification_service.api_token, :body => {:message => '[production][foo#bar] FooError: Too Much Bar', :room => notification_service.room_id}).and_return(true)
12 12  
13 13 notification_service.create_notification(problem)
14 14 end
... ...