Commit 2b0d5900b28a2846b880f31d12a123193c5f9ec6

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

replace faraday with httparty

@@ -55,7 +55,7 @@ gem 'hoi' @@ -55,7 +55,7 @@ gem 'hoi'
55 # Pushover (iOS Push notifications) 55 # Pushover (iOS Push notifications)
56 gem 'rushover' 56 gem 'rushover'
57 # Hubot 57 # Hubot
58 -gem 'faraday' 58 +gem 'httparty'
59 59
60 # Authentication 60 # Authentication
61 # --------------------------------------- 61 # ---------------------------------------
@@ -344,7 +344,6 @@ DEPENDENCIES @@ -344,7 +344,6 @@ DEPENDENCIES
344 email_spec 344 email_spec
345 execjs 345 execjs
346 fabrication (~> 1.3.0) 346 fabrication (~> 1.3.0)
347 - faraday  
348 foreman 347 foreman
349 gitlab! 348 gitlab!
350 haml 349 haml
@@ -352,6 +351,7 @@ DEPENDENCIES @@ -352,6 +351,7 @@ DEPENDENCIES
352 hoi 351 hoi
353 hoptoad_notifier (~> 2.4) 352 hoptoad_notifier (~> 2.4)
354 htmlentities (~> 4.3.0) 353 htmlentities (~> 4.3.0)
  354 + httparty
355 inherited_resources 355 inherited_resources
356 kaminari (>= 0.14.1) 356 kaminari (>= 0.14.1)
357 launchy 357 launchy
app/models/notification_services/hubot_service.rb
@@ -26,7 +26,7 @@ class NotificationServices::HubotService < NotificationService @@ -26,7 +26,7 @@ class NotificationServices::HubotService < NotificationService
26 end 26 end
27 27
28 def create_notification(problem) 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 end 30 end
31 end 31 end
32 32
spec/models/notification_service/hubot_service_spec.rb
@@ -8,7 +8,7 @@ describe NotificationService::HubotService do @@ -8,7 +8,7 @@ describe NotificationService::HubotService do
8 problem = notice.problem 8 problem = notice.problem
9 9
10 # faraday stubbing 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 notification_service.create_notification(problem) 13 notification_service.create_notification(problem)
14 end 14 end