Browse files

Set the user agent, so it works in all Ruby versions

  • Loading branch information...
1 parent 11487ed commit e9571387092826c91979ad604494a3b4ce291e37 @iain committed Apr 5, 2012
Showing with 2 additions and 1 deletion.
  1. +1 −0 lib/capistrano/blaze.rb
  2. +1 −1 spec/camp_spec.rb
View
1 lib/capistrano/blaze.rb
@@ -25,6 +25,7 @@ def speak(message)
req.basic_auth @config.token, 'X'
req.body = { :message => { :body => message } }.to_json
req.content_type = "application/json"
+ req["User-Agent"] = "Capistrano::Blaze"
res = Net::HTTP.start("#{@config.account}.campfirenow.com", port, :use_ssl => @config.ssl) do |http|
http.request(req)
View
2 spec/camp_spec.rb
@@ -11,7 +11,7 @@
stub_request(:post, "http://#{token}:X@#{account}.campfirenow.com/room/#{room_id}/speak.json").
with(:body => "{\"message\":{\"body\":\"Ik ben een gem aan het maken\"}}",
- :headers => {'Accept'=>'*/*', 'Content-Type'=>'application/json', 'User-Agent'=>'Ruby'}).
+ :headers => {'Accept'=>'*/*', 'Content-Type'=>'application/json', 'User-Agent'=>'Capistrano::Blaze'}).
to_return(:status => 200, :body => "", :headers => {})
subject.configure do |config|

0 comments on commit e957138

Please sign in to comment.