Skip to content
This repository

Faraday 0.8 #546

Closed
wants to merge 3 commits into from

1 participant

risk danger olson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.

Showing 51 changed files with 80 additions and 83 deletions. Show diff stats Hide diff stats

  1. 2  Gemfile
  2. 9  Gemfile.lock
  3. 2  github-services.gemspec
  4. 4  lib/services/shiningpanda.rb
  5. 4  test/CodePorting-C#2Java_test.rb
  6. 4  test/active_collab_test.rb
  7. 4  test/bamboo_test.rb
  8. 2  test/codeclimate_test.rb
  9. 2  test/coffeedocinfo_test.rb
  10. 4  test/depending_test.rb
  11. 2  test/deploy_hq_test.rb
  12. 6  test/ducksboard_test.rb
  13. 4  test/firebase_test.rb
  14. 2  test/habitualist_test.rb
  15. 2  test/hip_chat_test.rb
  16. 2  test/hostedgraphite.rb
  17. 14  test/icescrum_test.rb
  18. 2  test/jenkins_git_test.rb
  19. 2  test/jquery_plugins_test.rb
  20. 2  test/lingohub_test.rb
  21. 4  test/notifo_test.rb
  22. 2  test/notifymyandroid_test.rb
  23. 6  test/packagist_test.rb
  24. 2  test/planio_test.rb
  25. 2  test/prowl_test.rb
  26. 2  test/pushover_test.rb
  27. 2  test/pythonpackages_test.rb
  28. 2  test/rails_brakeman_test.rb
  29. 2  test/railsbp_test.rb
  30. 2  test/rapidpush_test.rb
  31. 2  test/rdocinfo_test.rb
  32. 2  test/read_the_docs_test.rb
  33. 16  test/redmine_test.rb
  34. 2  test/scrumdo_test.rb
  35. 2  test/service_test.rb
  36. 10  test/shiningpanda_test.rb
  37. 2  test/socialcast_test.rb
  38. 2  test/splendid_bacon_test.rb
  39. 2  test/statusnet_test.rb
  40. 2  test/talker_test.rb
  41. 2  test/test_pilot_test.rb
  42. 2  test/trac_test.rb
  43. 4  test/travis_test.rb
  44. 8  test/web_test.rb
  45. 2  test/web_translate_it_test.rb
  46. 2  test/zohoprojects_test.rb
  47. BIN  vendor/cache/faraday-0.7.6.gem
  48. BIN  vendor/cache/faraday-0.8.6.gem
  49. BIN  vendor/cache/multipart-post-1.1.5.gem
  50. BIN  vendor/cache/multipart-post-1.2.0.gem
  51. BIN  vendor/cache/rack-1.4.1.gem
2  Gemfile
@@ -5,7 +5,7 @@ gem 'yajl-ruby',              '1.1.0'
5 5
 gem "mash",                   "~> 0.1.1"
6 6
 gem "mime-types",             "~> 1.15"
7 7
 gem "ruby-hmac",              "0.4.0"
8  
-gem "faraday",                "0.7.6"
  8
+gem "faraday",                "~> 0.8.6"
9 9
 gem "SystemTimer"
10 10
 
11 11
   # Basecamp Classic
9  Gemfile.lock
@@ -18,10 +18,8 @@ GEM
18 18
     builder (2.1.2)
19 19
     crack (0.1.8)
20 20
     eventmachine (0.12.10)
21  
-    faraday (0.7.6)
22  
-      addressable (~> 2.2)
  21
+    faraday (0.8.6)
23 22
       multipart-post (~> 1.1)
24  
-      rack (~> 1.1)
25 23
     faraday_middleware (0.8.7)
26 24
       faraday (>= 0.7.4, < 0.9)
27 25
     hashie (1.2.0)
@@ -40,11 +38,10 @@ GEM
40 38
     mime-types (1.18)
41 39
     mqtt (0.0.8)
42 40
     multi_json (1.3.2)
43  
-    multipart-post (1.1.5)
  41
+    multipart-post (1.2.0)
44 42
     nokogiri (1.5.6)
45 43
     oauth (0.4.4)
46 44
     polyglot (0.3.3)
47  
-    rack (1.4.1)
48 45
     rake (0.8.7)
49 46
     rest-client (1.6.7)
50 47
       mime-types (>= 1.16)
@@ -92,7 +89,7 @@ DEPENDENCIES
92 89
   activeresource (~> 3.0.0)
93 90
   addressable (~> 2.2.7)
94 91
   aws-sdk (~> 1.8.0)
95  
-  faraday (= 0.7.6)
  92
+  faraday (~> 0.8.0)
96 93
   httparty (= 0.7.4)
97 94
   mail (~> 2.3)
98 95
   mash (~> 0.1.1)
2  github-services.gemspec
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25 25
   spec.add_dependency "mash",                   "~> 0.1.1"
26 26
   spec.add_dependency "mime-types",             "~> 1.15"
27 27
   spec.add_dependency "ruby-hmac",              "0.4.0"
28  
-  spec.add_dependency "faraday",                "0.7.6"
  28
+  spec.add_dependency "faraday",                "~> 0.8.6"
29 29
   spec.add_dependency "SystemTimer"
30 30
 
31 31
   # Basecamp Classic
4  lib/services/shiningpanda.rb
@@ -21,7 +21,7 @@ def receive_push
21 21
     end
22 22
     branch = payload['ref'].to_s.split('/').last
23 23
     if branches.empty? || branches.include?(branch)
24  
-      Rack::Utils.parse_query(data['parameters']).each do |key, values|
  24
+      Faraday::Utils.parse_query(data['parameters']).each do |key, values|
25 25
         if !values.is_a?(String) and values.length > 1
26 26
           raise_config_error "Only one parameter value allowed for " + key
27 27
         end
@@ -53,7 +53,7 @@ def branches
53 53
   end
54 54
 
55 55
   def parameters
56  
-    @parameters ||= Rack::Utils.parse_nested_query(cleanup('parameters'))
  56
+    @parameters ||= Faraday::Utils.parse_nested_query(cleanup('parameters'))
57 57
   end
58 58
 
59 59
   def query
4  test/CodePorting-C#2Java_test.rb
@@ -4,7 +4,7 @@ class CodePortingCSharp2JavaTest < Service::TestCase
4 4
   def setup
5 5
     @stubs = Faraday::Adapter::Test::Stubs.new
6 6
     @stubs.post '/csharp2java/v0/UserSignin' do |env|
7  
-      form = Rack::Utils.parse_query(env[:body])
  7
+      form = Faraday::Utils.parse_query(env[:body])
8 8
       assert_equal 'codeportingtest', form['LoginName']
9 9
       assert_equal 'testpassword', form['Password']
10 10
       [200, {}, %(<xml><Token>MONKEY</Token><return success="True"></return></xml>)]
@@ -13,7 +13,7 @@ def setup
13 13
 
14 14
   def test_push
15 15
     @stubs.post '/csharp2java/v0/githubpluginsupport' do |env|
16  
-      form = Rack::Utils.parse_query(env[:body])
  16
+      form = Faraday::Utils.parse_query(env[:body])
17 17
       assert_equal 'MONKEY', form['token']
18 18
       assert_equal 'Test_Project', form['ProjectName']
19 19
       assert_equal 'Test', form['RepoKey']
4  test/active_collab_test.rb
@@ -7,8 +7,8 @@ def setup
7 7
 
8 8
   def test_push
9 9
     @stubs.post "/foo" do |env|
10  
-      query = Rack::Utils.parse_nested_query(env[:url].query)
11  
-      body  = Rack::Utils.parse_nested_query(env[:body])
  10
+      query = Faraday::Utils.parse_nested_query(env[:url].query)
  11
+      body  = Faraday::Utils.parse_nested_query(env[:body])
12 12
       assert_equal '2', body['discussion']['milestone_id']
13 13
       assert_equal '3', body['discussion']['parent_id']
14 14
       assert_equal 'activecollab.com', env[:url].host
4  test/bamboo_test.rb
@@ -141,7 +141,7 @@ def compound_data1
141 141
   # Raises Test::Unit::AssertionFailedError if the assertion doesn't match.
142 142
   # Returns nothing.
143 143
   def assert_params(body, expected)
144  
-    params = Rack::Utils.parse_query(body)
  144
+    params = Faraday::Utils.parse_query(body)
145 145
     expected.each do |key, expected_value|
146 146
       assert value = params.delete(key.to_s), "#{key} not in #{params.inspect}"
147 147
       assert_equal expected_value, value, "#{key} = #{value.inspect}, not #{expected_value.inspect}"
@@ -154,7 +154,7 @@ def service(*args)
154 154
     super Service::Bamboo, *args
155 155
   end
156 156
 
157  
-  private 
  157
+  private
158 158
   def valid_response(key)
159 159
     xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>" +
160 160
     "<restQueuedBuild buildResultKey=\"#{key}-7\" buildNumber=\"7\" planKey=\"#{key}\">" +
2  test/codeclimate_test.rb
@@ -21,7 +21,7 @@ def test_posts_payload
21 21
       assert_equal 'codeclimate.com', env[:url].host
22 22
       assert_equal basic_auth('github', '5373dd4a3648b88fa9acb8e46ebc188a'),
23 23
         env[:request_headers]['authorization']
24  
-      assert_equal payload, JSON.parse(Rack::Utils.parse_query(env[:body])['payload'])
  24
+      assert_equal payload, JSON.parse(Faraday::Utils.parse_query(env[:body])['payload'])
25 25
     end
26 26
 
27 27
     @svc.receive_push
2  test/coffeedocinfo_test.rb
@@ -8,7 +8,7 @@ def setup
8 8
   def test_push
9 9
     @stubs.post "/checkout" do |env|
10 10
       assert_equal 'coffeedoc.info', env[:url].host
11  
-      data = Rack::Utils.parse_query(env[:body])
  11
+      data = Faraday::Utils.parse_query(env[:body])
12 12
       assert_equal 1, JSON.parse(data['payload'])['a']
13 13
       [200, {}, '']
14 14
     end
4  test/depending_test.rb
@@ -21,7 +21,7 @@ def test_post_payload
21 21
       assert_equal 'depending.in', env[:url].host
22 22
       assert_equal basic_auth('github', 'bf215181b5140522137b3d4f6b73544a'),
23 23
         env[:request_headers]['authorization']
24  
-      assert_equal payload, JSON.parse(Rack::Utils.parse_query(env[:body])['payload'])
  24
+      assert_equal payload, JSON.parse(Faraday::Utils.parse_query(env[:body])['payload'])
25 25
     end
26 26
 
27 27
     @svc.receive_push
@@ -37,4 +37,4 @@ def data
37 37
     { 'token' => 'bf215181b5140522137b3d4f6b73544a' }
38 38
   end
39 39
 
40  
-end
  40
+end
2  test/deploy_hq_test.rb
@@ -10,7 +10,7 @@ def test_push
10 10
     @stubs.post '/deploy/projectname/to/servername/serverkey' do |env|
11 11
       assert_equal 'test.deployhq.com', env[:url].host
12 12
       assert_equal 'https', env[:url].scheme
13  
-      post_payload = JSON.parse(Rack::Utils.parse_query(env[:body])['payload'])
  13
+      post_payload = JSON.parse(Faraday::Utils.parse_query(env[:body])['payload'])
14 14
 
15 15
       assert_not_nil payload['after']
16 16
       assert_equal post_payload['after'], post_payload['after']
6  test/ducksboard_test.rb
@@ -10,7 +10,7 @@ def receive_helper(event)
10 10
     svc = service(event, {'webhook_key' => '1234abcd'}, payload)
11 11
 
12 12
     @stubs.post '/1234abcd' do |env|
13  
-      body = Rack::Utils.parse_nested_query(env[:body])
  13
+      body = Faraday::Utils.parse_nested_query(env[:body])
14 14
       recv = JSON.parse(body['content'])
15 15
       assert_equal recv['payload'], payload
16 16
       assert_equal recv['event'], event.to_s
@@ -33,7 +33,7 @@ def test_webhook_key_through_url
33 33
     }, payload)
34 34
 
35 35
     @stubs.post '/abcd1234' do |env|
36  
-      body = Rack::Utils.parse_nested_query(env[:body])
  36
+      body = Faraday::Utils.parse_nested_query(env[:body])
37 37
       recv = JSON.parse(body['content'])
38 38
       assert_equal recv['payload'], payload
39 39
       [200, {}, '']
@@ -53,7 +53,7 @@ def test_many_webhook_keys
53 53
     (1..6).each do |endpoint|
54 54
       @stubs.post "/#{endpoint}" do |env|
55 55
         posted << endpoint
56  
-        body = Rack::Utils.parse_nested_query(env[:body])
  56
+        body = Faraday::Utils.parse_nested_query(env[:body])
57 57
         recv = JSON.parse(body['content'])
58 58
         assert_equal recv['payload'], payload
59 59
         [200, {}, '']
4  test/firebase_test.rb
@@ -29,7 +29,7 @@ def test_push
29 29
 
30 30
   def test_push_with_secret
31 31
     @stubs.post '/commits.json' do |env|
32  
-      params = Rack::Utils.parse_nested_query(env[:url].query)
  32
+      params = Faraday::Utils.parse_nested_query(env[:url].query)
33 33
       assert_equal({'auth' => '12345678abcdefgh'}, params)
34 34
     end
35 35
 
@@ -43,7 +43,7 @@ def test_push_with_secret
43 43
    def test_push_with_suffix
44 44
     @stubs.post '/commits.json' do |env|
45 45
       assert_equal 'test.firebaseio.com', env[:url].host
46  
-      params = Rack::Utils.parse_nested_query(env[:url].query)
  46
+      params = Faraday::Utils.parse_nested_query(env[:url].query)
47 47
       assert_equal({'auth' => '12345678abcdefgh'}, params)
48 48
       [200, {}, '']
49 49
     end
2  test/habitualist_test.rb
@@ -8,7 +8,7 @@ def setup
8 8
   def test_push
9 9
     @stubs.post "/webhooks/github/" do |env|
10 10
       assert_equal 'habitualist.com', env[:url].host
11  
-      data = Rack::Utils.parse_query(env[:body])
  11
+      data = Faraday::Utils.parse_query(env[:body])
12 12
       assert_equal 1, JSON.parse(data['payload'])['a']
13 13
       [200, {}, '']
14 14
     end
2  test/hip_chat_test.rb
@@ -8,7 +8,7 @@ def setup
8 8
   def test_push
9 9
     payload = {'a' => 1, 'ref' => 'refs/heads/master'}
10 10
     @stubs.post "/v1/webhooks/github" do |env|
11  
-      form = Rack::Utils.parse_query(env[:body])
  11
+      form = Faraday::Utils.parse_query(env[:body])
12 12
       assert_equal payload, JSON.parse(form['payload'])
13 13
       assert_equal 'a', form['auth_token']
14 14
       assert_equal 'r', form['room_id']
2  test/hostedgraphite.rb
@@ -8,7 +8,7 @@ def setup
8 8
   def test_push
9 9
     url = "/integrations/github/"
10 10
     @stubs.post url do |env|
11  
-      params = Rack::Utils.parse_query env[:body]
  11
+      params = Faraday::Utils.parse_query env[:body]
12 12
       assert_equal 'payload', JSON.parse(params['payload'])
13 13
       assert_equal 'test', params['api_key']
14 14
       [200, {}, '']
14  test/icescrum_test.rb
@@ -9,7 +9,7 @@ def test_push_valid
9 9
     @stubs.post "/a/ws/p/TESTPROJ/commit" do |env|
10 10
       assert_equal 'www.kagilum.com', env[:url].host
11 11
       assert_equal basic_auth(:u, :p), env[:request_headers]['authorization']
12  
-      body = Rack::Utils.parse_nested_query(env[:body])
  12
+      body = Faraday::Utils.parse_nested_query(env[:body])
13 13
       recv = JSON.parse(body['payload'])
14 14
       assert_equal payload, recv
15 15
       [200, {}, '']
@@ -29,9 +29,9 @@ def test_push_valid_custom_url
29 29
     @stubs.post "/icescrum/ws/p/TESTPROJ/commit" do |env|
30 30
       assert_equal 'www.example.com', env[:url].host
31 31
       assert_equal basic_auth(:u, :p), env[:request_headers]['authorization']
32  
-      body = Rack::Utils.parse_nested_query(env[:body])
  32
+      body = Faraday::Utils.parse_nested_query(env[:body])
33 33
       recv = JSON.parse(body['payload'])
34  
-      assert_equal payload, recv      
  34
+      assert_equal payload, recv
35 35
       [200, {}, '']
36 36
     end
37 37
 
@@ -49,9 +49,9 @@ def test_push_valid_custom_url
49 49
   def test_push_lowcase_project_key
50 50
     @stubs.post "/a/ws/p/TESTPROJ/commit" do |env|
51 51
       assert_equal basic_auth(:u, :p), env[:request_headers]['authorization']
52  
-      body = Rack::Utils.parse_nested_query(env[:body])
  52
+      body = Faraday::Utils.parse_nested_query(env[:body])
53 53
       recv = JSON.parse(body['payload'])
54  
-      assert_equal payload, recv      
  54
+      assert_equal payload, recv
55 55
       [200, {}, '']
56 56
     end
57 57
 
@@ -68,7 +68,7 @@ def test_push_lowcase_project_key
68 68
 def test_push_whitespace_project_key
69 69
     @stubs.post "/a/ws/p/TESTPROJ/commit" do |env|
70 70
       assert_equal basic_auth(:u, :p), env[:request_headers]['authorization']
71  
-      body = Rack::Utils.parse_nested_query(env[:body])
  71
+      body = Faraday::Utils.parse_nested_query(env[:body])
72 72
       recv = JSON.parse(body['payload'])
73 73
       assert_equal payload, recv
74 74
       [200, {}, '']
@@ -106,7 +106,7 @@ def test_push_missing_password
106 106
     end
107 107
   end
108 108
 
109  
-  def test_push_missing_project_key 
  109
+  def test_push_missing_project_key
110 110
     svc = service({
111 111
       'username' => 'u',
112 112
       'password' => 'p',
2  test/jenkins_git_test.rb
@@ -12,7 +12,7 @@ def test_push
12 12
 
13 13
       assert_equal 'Basic bW9ua2V5OnNlY3JldA==', env[:request_headers]['authorization']
14 14
 
15  
-      params = Rack::Utils.parse_nested_query(env[:url].query)
  15
+      params = Faraday::Utils.parse_nested_query(env[:url].query)
16 16
       expected_params = {
17 17
         'url' => 'http://github.com/mojombo/grit',
18 18
         'branches' => 'master',
2  test/jquery_plugins_test.rb
@@ -10,7 +10,7 @@ def test_push
10 10
 
11 11
     @stubs.post "/postreceive-hook" do |env|
12 12
       assert_equal 'plugins.jquery.com', env[:url].host
13  
-      data = Rack::Utils.parse_nested_query(env[:body])
  13
+      data = Faraday::Utils.parse_nested_query(env[:body])
14 14
       assert_equal 1, JSON.parse(data['payload'])['a']
15 15
       [200, {}, '']
16 16
     end
2  test/lingohub_test.rb
@@ -20,7 +20,7 @@ def test_http_call
20 20
   def test_payload
21 21
     @stubs.post "/github_callback" do |env|
22 22
 
23  
-      body = Rack::Utils.parse_nested_query(env[:body])
  23
+      body = Faraday::Utils.parse_nested_query(env[:body])
24 24
       received_payload =  JSON.parse(body['payload'])
25 25
 
26 26
       assert_equal payload['after'], received_payload['after']
4  test/notifo_test.rb
@@ -10,14 +10,14 @@ def test_push
10 10
     notified   = %w(a b)
11 11
     @stubs.post "/v1/subscribe_user" do |env|
12 12
       assert_equal 'api.notifo.com', env[:url].host
13  
-      data = Rack::Utils.parse_nested_query(env[:body])
  13
+      data = Faraday::Utils.parse_nested_query(env[:body])
14 14
       assert_equal subscribed.shift, data['username']
15 15
       [200, {}, '']
16 16
     end
17 17
 
18 18
     @stubs.post "/v1/send_notification" do |env|
19 19
       assert_equal 'api.notifo.com', env[:url].host
20  
-      data = Rack::Utils.parse_nested_query(env[:body])
  20
+      data = Faraday::Utils.parse_nested_query(env[:body])
21 21
       assert_equal notified.shift, data['to']
22 22
       [200, {}, '']
23 23
     end
2  test/notifymyandroid_test.rb
@@ -8,7 +8,7 @@ def setup
8 8
   def test_push
9 9
     @stubs.post "/publicapi/notify" do |env|
10 10
       assert_equal 'www.notifymyandroid.com', env[:url].host
11  
-      data = Rack::Utils.parse_query(env[:body])
  11
+      data = Faraday::Utils.parse_query(env[:body])
12 12
       assert_equal 'a', data['apikey']
13 13
       [200, {}, '']
14 14
     end
6  test/packagist_test.rb
@@ -31,9 +31,9 @@ def test_constructs_post_receive_url
31 31
   def test_posts_payload
32 32
     @stubs.post '/api/github' do |env|
33 33
       assert_equal 'packagist.example.com', env[:url].host
34  
-      assert_equal 'simensen', Rack::Utils.parse_query(env[:body])['username']
35  
-      assert_equal '5gieo7lwcd8gww800scs', Rack::Utils.parse_query(env[:body])['apiToken']
36  
-      assert_equal payload, JSON.parse(Rack::Utils.parse_query(env[:body])['payload'])
  34
+      assert_equal 'simensen', Faraday::Utils.parse_query(env[:body])['username']
  35
+      assert_equal '5gieo7lwcd8gww800scs', Faraday::Utils.parse_query(env[:body])['apiToken']
  36
+      assert_equal payload, JSON.parse(Faraday::Utils.parse_query(env[:body])['payload'])
37 37
     end
38 38
     @svc.receive_push
39 39
   end
2  test/planio_test.rb
@@ -8,7 +8,7 @@ def setup
8 8
   def test_push
9 9
     @stubs.get "/a/sys/fetch_changesets" do |env|
10 10
       assert_equal 'r.com', env[:url].host
11  
-      data = Rack::Utils.parse_nested_query(env[:body])
  11
+      data = Faraday::Utils.parse_nested_query(env[:body])
12 12
       assert_equal 'a', env[:params]['key']
13 13
       assert_equal 'p', env[:params]['id']
14 14
       [200, {}, '']
2  test/prowl_test.rb
@@ -8,7 +8,7 @@ def setup
8 8
   def test_push
9 9
     @stubs.post "/publicapi/add" do |env|
10 10
       assert_equal 'api.prowlapp.com', env[:url].host
11  
-      data = Rack::Utils.parse_query(env[:body])
  11
+      data = Faraday::Utils.parse_query(env[:body])
12 12
       assert_equal 'a', data['apikey']
13 13
       [200, {}, '']
14 14
     end
2  test/pushover_test.rb
@@ -14,7 +14,7 @@ def svc.shorten_url(*args)
14 14
 
15 15
     @stubs.post "/1/messages.json" do |env|
16 16
       assert_equal "api.pushover.net", env[:url].host
17  
-      data = Rack::Utils.parse_query(env[:body])
  17
+      data = Faraday::Utils.parse_query(env[:body])
18 18
       assert_equal "a", data["user"]
19 19
       assert_equal "hi", data["device"]
20 20
       [200, {}, '']
2  test/pythonpackages_test.rb
@@ -8,7 +8,7 @@ def setup
8 8
   def test_push
9 9
     @stubs.post "/github" do |env|
10 10
       assert_equal 'pythonpackages.com', env[:url].host
11  
-      data = Rack::Utils.parse_query(env[:body])
  11
+      data = Faraday::Utils.parse_query(env[:body])
12 12
       assert_equal 1, JSON.parse(data['payload'])['a']
13 13
       [200, {}, '']
14 14
     end
2  test/rails_brakeman_test.rb
@@ -29,7 +29,7 @@ def test_strips_whitespace_from_form_values
29 29
 
30 30
   def test_posts_payload
31 31
     @stubs.post "/" do |env|
32  
-      assert_equal payload, JSON.parse(Rack::Utils.parse_query(env[:body])['payload'])
  32
+      assert_equal payload, JSON.parse(Faraday::Utils.parse_query(env[:body])['payload'])
33 33
     end
34 34
     @svc.receive_push
35 35
   end
2  test/railsbp_test.rb
@@ -29,7 +29,7 @@ def test_strips_whitespace_from_form_values
29 29
 
30 30
   def test_posts_payload
31 31
     @stubs.post "/" do |env|
32  
-      assert_equal payload, JSON.parse(Rack::Utils.parse_query(env[:body])['payload'])
  32
+      assert_equal payload, JSON.parse(Faraday::Utils.parse_query(env[:body])['payload'])
33 33
     end
34 34
     @svc.receive_push
35 35
   end
2  test/rapidpush_test.rb
@@ -8,7 +8,7 @@ def setup
8 8
   def test_push
9 9
     @stubs.post "/api/github/a" do |env|
10 10
       assert_equal 'rapidpush.net', env[:url].host
11  
-      data = Rack::Utils.parse_query(env[:body])
  11
+      data = Faraday::Utils.parse_query(env[:body])
12 12
       assert_equal payload.to_json, data['payload']
13 13
       [200, {}, '']
14 14
     end
2  test/rdocinfo_test.rb
@@ -8,7 +8,7 @@ def setup
8 8
   def test_push
9 9
     @stubs.post "/checkout" do |env|
10 10
       assert_equal 'rubydoc.info', env[:url].host
11  
-      data = Rack::Utils.parse_query(env[:body])
  11
+      data = Faraday::Utils.parse_query(env[:body])
12 12
       assert_equal 1, JSON.parse(data['payload'])['a']
13 13
       [200, {}, '']
14 14
     end
2  test/read_the_docs_test.rb
@@ -8,7 +8,7 @@ def setup
8 8
   def test_push
9 9
     @stubs.post "/github" do |env|
10 10
       assert_equal 'readthedocs.org', env[:url].host
11  
-      data = Rack::Utils.parse_query(env[:body])
  11
+      data = Faraday::Utils.parse_query(env[:body])
12 12
       assert_equal 1, JSON.parse(data['payload'])['a']
13 13
       [200, {}, '']
14 14
     end
16  test/redmine_test.rb
@@ -8,7 +8,7 @@ def setup
8 8
   def test_push
9 9
     @stubs.get "/a/sys/fetch_changesets" do |env|
10 10
       assert_equal 'r.com', env[:url].host
11  
-      data = Rack::Utils.parse_nested_query(env[:body])
  11
+      data = Faraday::Utils.parse_nested_query(env[:body])
12 12
       assert_equal 'a', env[:params]['key']
13 13
       assert_equal 'p', env[:params]['id']
14 14
       [200, {}, '']
@@ -28,17 +28,17 @@ def test_update_issue_module
28 28
       [200, {}, '']
29 29
     end
30 30
     configurations = {
31  
-      'address' => "http://redmine.org", 
  31
+      'address' => "http://redmine.org",
32 32
       'api_key' => "API_KEY-654321",
33 33
       'update_redmine_issues_about_commits' => true
34 34
     }
35 35
     payloads = {
36  
-      'commits' => [ 
37  
-                    { 'message' => "FIX Issue #1234", 
38  
-                       'timestamp' => "2007-10-10T00:11:02-07:00", 
39  
-                       'id' => "b44aa57a6c6c52cc20b9e396cfe3cf97bdfc2b33", 
40  
-                       'url' => "https://github.com/modsaid/github-services/commit/b44aa57a6c6c52cc20b9e396cfe3cf97bdfc2b33", 
41  
-                       'author' => {'name' => "Mahmoud", 'email' => "modsaid@example.com"}, 
  36
+      'commits' => [
  37
+                    { 'message' => "FIX Issue #1234",
  38
+                       'timestamp' => "2007-10-10T00:11:02-07:00",
  39
+                       'id' => "b44aa57a6c6c52cc20b9e396cfe3cf97bdfc2b33",
  40
+                       'url' => "https://github.com/modsaid/github-services/commit/b44aa57a6c6c52cc20b9e396cfe3cf97bdfc2b33",
  41
+                       'author' => {'name' => "Mahmoud", 'email' => "modsaid@example.com"},
42 42
                        'added' => [], 'removed' => [], 'modified' => []
43 43
                     }
44 44
                   ]
2  test/scrumdo_test.rb
@@ -8,7 +8,7 @@ def setup
8 8
   def test_push
9 9
     @stubs.post "/hooks/github/slug" do |env|
10 10
       assert_equal 'www.scrumdo.com', env[:url].host
11  
-      data = Rack::Utils.parse_query(env[:body])
  11
+      data = Faraday::Utils.parse_query(env[:body])
12 12
       assert_equal 'rick',   data['username']
13 13
       assert_equal 'monkey', data['password']
14 14
       assert data['payload']
2  test/service_test.rb
@@ -54,7 +54,7 @@ def test_url_shorten
54 54
     url = "http://github.com"
55 55
     @stubs.post "/" do |env|
56 56
       assert_equal 'git.io', env[:url].host
57  
-      data = Rack::Utils.parse_query(env[:body])
  57
+      data = Faraday::Utils.parse_query(env[:body])
58 58
       assert_equal url, data['url']
59 59
       [201, {'Location' => 'short'}, '']
60 60
     end
10  test/shiningpanda_test.rb
@@ -7,7 +7,7 @@ def setup
7 7
 
8 8
   def test_receive_push_without_parameters
9 9
     @stubs.post '/shiningpanda.org/job/pygments/build' do |env|
10  
-      form = Rack::Utils.parse_query(env[:body])
  10
+      form = Faraday::Utils.parse_query(env[:body])
11 11
       assert_equal 'PWFm8c2T', form['token']
12 12
       assert_equal 'Triggered by a push of omansion to master (commit: 83d9205e73c25092ce7cb7ce530d2414e6d068cb)', form['cause']
13 13
     end
@@ -17,7 +17,7 @@ def test_receive_push_without_parameters
17 17
 
18 18
   def test_receive_push_with_parameters
19 19
     @stubs.post '/shiningpanda.org/job/pygments/buildWithParameters' do |env|
20  
-      form = Rack::Utils.parse_query(env[:body])
  20
+      form = Faraday::Utils.parse_query(env[:body])
21 21
       assert_equal 'PWFm8c2T', form['token']
22 22
       assert_equal 'Triggered by a push of omansion to master (commit: 83d9205e73c25092ce7cb7ce530d2414e6d068cb)', form['cause']
23 23
       assert_equal 'bar', form['foo']
@@ -28,7 +28,7 @@ def test_receive_push_with_parameters
28 28
 
29 29
   def test_receive_push_branch_match
30 30
     @stubs.post '/shiningpanda.org/job/pygments/build' do |env|
31  
-      form = Rack::Utils.parse_query(env[:body])
  31
+      form = Faraday::Utils.parse_query(env[:body])
32 32
       assert_equal 'PWFm8c2T', form['token']
33 33
       assert_equal 'Triggered by a push of omansion to dev (commit: 83d9205e73c25092ce7cb7ce530d2414e6d068cb)', form['cause']
34 34
     end
@@ -38,7 +38,7 @@ def test_receive_push_branch_match
38 38
 
39 39
   def test_receive_push_branches_match
40 40
     @stubs.post '/shiningpanda.org/job/pygments/build' do |env|
41  
-      form = Rack::Utils.parse_query(env[:body])
  41
+      form = Faraday::Utils.parse_query(env[:body])
42 42
       assert_equal 'PWFm8c2T', form['token']
43 43
       assert_equal 'Triggered by a push of omansion to master (commit: 83d9205e73c25092ce7cb7ce530d2414e6d068cb)', form['cause']
44 44
     end
@@ -165,7 +165,7 @@ def test_url_strip_job
165 165
 
166 166
   def test_strip_token
167 167
     @stubs.post '/shiningpanda.org/job/pygments/build' do |env|
168  
-      assert_equal 'PWFm8c2T', Rack::Utils.parse_query(env[:body])['token']
  168
+      assert_equal 'PWFm8c2T', Faraday::Utils.parse_query(env[:body])['token']
169 169
     end
170 170
     svc = service(data.merge({'token' => ' PWFm8c2T '}), payload)
171 171
     svc.receive_push
2  test/socialcast_test.rb
@@ -9,7 +9,7 @@ def test_push
9 9
     @stubs.post "/api/messages.xml" do |env|
10 10
       assert_equal 'd', env[:url].host
11 11
       assert_equal basic_auth(:u, :p), env[:request_headers]['authorization']
12  
-      data = Rack::Utils.parse_nested_query(env[:body])
  12
+      data = Faraday::Utils.parse_nested_query(env[:body])
13 13
       msg  = data['message']
14 14
       assert_match 'Tom Preston-Werner', msg['body']
15 15
       assert_match '3 commits', msg['title']
2  test/splendid_bacon_test.rb
@@ -8,7 +8,7 @@ def setup
8 8
   def test_push
9 9
     @stubs.post "/api/v1/projects/p/github" do |env|
10 10
       assert_equal 'splendidbacon.com', env[:url].host
11  
-      data = Rack::Utils.parse_nested_query(env[:body])
  11
+      data = Faraday::Utils.parse_nested_query(env[:body])
12 12
       assert_equal 1, JSON.parse(data['payload'])['a']
13 13
       [200, {}, '']
14 14
     end
2  test/statusnet_test.rb
@@ -8,7 +8,7 @@ def setup
8 8
   def test_push
9 9
     @stubs.post "/api/statuses/update.xml" do |env|
10 10
       assert_equal 's.com', env[:url].host
11  
-      data = Rack::Utils.parse_nested_query(env[:body])
  11
+      data = Faraday::Utils.parse_nested_query(env[:body])
12 12
       assert_equal 'github', data['source']
13 13
       [200, {}, '']
14 14
     end
2  test/talker_test.rb
@@ -54,7 +54,7 @@ def stub_message_posting
54 54
       @stubs.post "/room/1/messages.json" do |env|
55 55
         assert_equal 's.talkerapp.com', env[:url].host
56 56
         assert_equal 't', env[:request_headers]['x-talker-token']
57  
-        data = Rack::Utils.parse_nested_query(env[:body])
  57
+        data = Faraday::Utils.parse_nested_query(env[:body])
58 58
         assert data.key?('message')
59 59
         [200, {}, '']
60 60
       end
2  test/test_pilot_test.rb
@@ -28,7 +28,7 @@ def test_constructs_post_receive_url
28 28
   def test_posts_payload
29 29
     @stubs.post '/callbacks/github' do |env|
30 30
       assert_equal env[:params]['token'], @svc.token
31  
-      assert_equal payload, JSON.parse(Rack::Utils.parse_query(env[:body])['payload'])
  31
+      assert_equal payload, JSON.parse(Faraday::Utils.parse_query(env[:body])['payload'])
32 32
     end
33 33
     @svc.receive_push
34 34
   end
2  test/trac_test.rb
@@ -9,7 +9,7 @@ def test_push
9 9
     @stubs.post "/s/github/t" do |env|
10 10
       assert_equal 's.trac.com', env[:url].host
11 11
       assert_equal basic_auth(:u, :p), env[:request_headers]['authorization']
12  
-      data = Rack::Utils.parse_nested_query(env[:body])
  12
+      data = Faraday::Utils.parse_nested_query(env[:body])
13 13
       assert_equal 1, JSON.parse(data['payload'])['a']
14 14
       [200, {}, '']
15 15
     end
4  test/travis_test.rb
@@ -38,7 +38,7 @@ def test_posts_payload
38 38
       assert_equal basic_auth('kronn', '5373dd4a3648b88fa9acb8e46ebc188a'),
39 39
         env[:request_headers]['authorization']
40 40
       assert_equal 'push', env[:request_headers]['x-github-event']
41  
-      assert_equal payload, JSON.parse(Rack::Utils.parse_query(env[:body])['payload'])
  41
+      assert_equal payload, JSON.parse(Faraday::Utils.parse_query(env[:body])['payload'])
42 42
     end
43 43
     @svc.receive_event
44 44
   end
@@ -50,7 +50,7 @@ def test_pull_request_payload
50 50
       assert_equal basic_auth('kronn', '5373dd4a3648b88fa9acb8e46ebc188a'),
51 51
         env[:request_headers]['authorization']
52 52
       assert_equal 'pull_request', env[:request_headers]['x-github-event']
53  
-      assert_equal pull_payload, JSON.parse(Rack::Utils.parse_query(env[:body])['payload'])
  53
+      assert_equal pull_payload, JSON.parse(Faraday::Utils.parse_query(env[:body])['payload'])
54 54
     end
55 55
     @svc.receive_event
56 56
   end
8  test/web_test.rb
@@ -16,9 +16,9 @@ def test_push
16 16
       assert_equal 'Basic bW9ua2V5OnNlY3JldA==', env[:request_headers]['authorization']
17 17
       assert_match /form/, env[:request_headers]['content-type']
18 18
       assert_equal 'abc.com', env[:url].host
19  
-      params = Rack::Utils.parse_nested_query(env[:url].query)
  19
+      params = Faraday::Utils.parse_nested_query(env[:url].query)
20 20
       assert_equal({'a' => '1'}, params)
21  
-      body = Rack::Utils.parse_nested_query(env[:body])
  21
+      body = Faraday::Utils.parse_nested_query(env[:body])
22 22
       assert_equal '1', body['a']
23 23
       recv = JSON.parse(body['payload'])
24 24
       assert_equal payload, recv
@@ -57,7 +57,7 @@ def test_push_with_secret
57 57
       assert_equal 'sha1='+OpenSSL::HMAC.hexdigest(Service::Web::HMAC_DIGEST,
58 58
                                         'monkey', env[:body]),
59 59
         env[:request_headers]['X-Hub-Signature']
60  
-      body = Rack::Utils.parse_nested_query(env[:body])
  60
+      body = Faraday::Utils.parse_nested_query(env[:body])
61 61
       recv = JSON.parse(body['payload'])
62 62
       assert_equal payload, recv
63 63
       [200, {}, '']
@@ -74,7 +74,7 @@ def test_push_as_json
74 74
 
75 75
     @stubs.post "/foo" do |env|
76 76
       assert_equal 'Basic bW9ua2V5OnNlY3JldA==', env[:request_headers]['authorization']
77  
-      params = Rack::Utils.parse_nested_query(env[:url].query)
  77
+      params = Faraday::Utils.parse_nested_query(env[:url].query)
78 78
       assert_equal({'a' => '1'}, params)
79 79
       assert_match /json/, env[:request_headers]['content-type']
80 80
       assert_equal 'abc.com', env[:url].host
2  test/web_translate_it_test.rb
@@ -8,7 +8,7 @@ def setup
8 8
   def test_push
9 9
     @stubs.post "/api/projects/a/refresh_files" do |env|
10 10
       assert_equal 'webtranslateit.com', env[:url].host
11  
-      data = Rack::Utils.parse_nested_query(env[:body])
  11
+      data = Faraday::Utils.parse_nested_query(env[:body])
12 12
       assert_equal 1, JSON.parse(data['payload'])['a']
13 13
       [200, {}, '']
14 14
     end
2  test/zohoprojects_test.rb
@@ -16,7 +16,7 @@ def test_push
16 16
     url = "/serviceHook"
17 17
     @stubs.post url do |env|
18 18
       assert_equal 'projects.zoho.com', env[:url].host
19  
-      params = Rack::Utils.parse_query env[:body]
  19
+      params = Faraday::Utils.parse_query env[:body]
20 20
       assert_equal '1234', params['pId']
21 21
       assert_equal 'a13d', params['authtoken']
22 22
       assert_equal payload, JSON.parse(params['payload'])
BIN  vendor/cache/faraday-0.7.6.gem
Binary file not shown
BIN  vendor/cache/faraday-0.8.6.gem
Binary file not shown
BIN  vendor/cache/multipart-post-1.1.5.gem
Binary file not shown
BIN  vendor/cache/multipart-post-1.2.0.gem
Binary file not shown
BIN  vendor/cache/rack-1.4.1.gem
Binary file not shown
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.