Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 4 files changed
  • 0 comments
  • 1 contributor
Mar 20, 2013
Eugene Pimenov Update rspec and friends.
Required for naming of the subject
a35381e
Eugene Pimenov Specify encoding in the POST request.
Viadeo doesn't have UTF-8 as the default encoding, so we have to specify
it explicitly.
adabab4
18 Gemfile.lock
@@ -17,7 +17,7 @@ GEM
17 17 addressable (2.2.6)
18 18 crack (0.3.1)
19 19 curb (0.8.3)
20   - diff-lcs (1.1.3)
  20 + diff-lcs (1.2.1)
21 21 hashie (2.0.3)
22 22 i18n (0.6.1)
23 23 json (1.6.1)
@@ -29,14 +29,14 @@ GEM
29 29 rake (0.9.2)
30 30 rdoc (3.10)
31 31 json (~> 1.4)
32   - rspec (2.7.0)
33   - rspec-core (~> 2.7.0)
34   - rspec-expectations (~> 2.7.0)
35   - rspec-mocks (~> 2.7.0)
36   - rspec-core (2.7.0)
37   - rspec-expectations (2.7.0)
38   - diff-lcs (~> 1.1.2)
39   - rspec-mocks (2.7.0)
  32 + rspec (2.13.0)
  33 + rspec-core (~> 2.13.0)
  34 + rspec-expectations (~> 2.13.0)
  35 + rspec-mocks (~> 2.13.0)
  36 + rspec-core (2.13.1)
  37 + rspec-expectations (2.13.0)
  38 + diff-lcs (>= 1.1.3, < 2.0)
  39 + rspec-mocks (2.13.0)
40 40 simplecov (0.5.4)
41 41 multi_json (~> 1.0.3)
42 42 simplecov-html (~> 0.5.3)
1  lib/viadeo/helpers/request.rb
@@ -50,6 +50,7 @@ def request(method, path, query, data, options)
50 50
51 51 if !data.respond_to?(:bytesize) && data.respond_to?(:map)
52 52 data = to_query(data)
  53 + c.headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8'
53 54 end
54 55
55 56 case method
6 spec/query_spec.rb
@@ -29,5 +29,11 @@
29 29 expect(obj.body.params.param1).to eq('test')
30 30 expect(obj.body.params.param2).to eq('body test')
31 31 end
  32 +
  33 + it 'supports unicode' do
  34 + obj = client.post('/test', {param1: 'test'}, {param2: [116, 233, 115, 116].pack("U*")})
  35 + expect(obj.body.params.param2).to eq([116, 233, 115, 116].pack("U*"))
  36 + expect(obj.body.content_type).to eq('application/x-www-form-urlencoded; charset=UTF-8')
  37 + end
32 38 end
33 39 end
2  spec/support/stub_server.rb
@@ -9,7 +9,7 @@ class DummyStubServer < Sinatra::Base
9 9 end
10 10
11 11 content_type :json
12   - {method: verb, url: request.fullpath, params: params}.to_json
  12 + {method: verb, url: request.fullpath, params: params, content_type: request.content_type}.to_json
13 13 end
14 14 end
15 15

No commit comments for this range

Something went wrong with that request. Please try again.