Commit 2b0d5900b28a2846b880f31d12a123193c5f9ec6
1 parent
d7dbe7f5
Exists in
master
and in
1 other branch
replace faraday with httparty
Showing
4 changed files
with
4 additions
and
4 deletions
Show diff stats
Gemfile
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 | ... | ... |