Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: libc/viadeo
base: 7c6ad9e5ee
...
head fork: libc/viadeo
compare: adabab4c9e
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
Commits on Mar 20, 2013
@libc Update rspec and friends.
Required for naming of the subject
a35381e
@libc Specify encoding in the POST request.
Viadeo doesn't have UTF-8 as the default encoding, so we have to specify
it explicitly.
adabab4
View
18 Gemfile.lock
@@ -17,7 +17,7 @@ GEM
addressable (2.2.6)
crack (0.3.1)
curb (0.8.3)
- diff-lcs (1.1.3)
+ diff-lcs (1.2.1)
hashie (2.0.3)
i18n (0.6.1)
json (1.6.1)
@@ -29,14 +29,14 @@ GEM
rake (0.9.2)
rdoc (3.10)
json (~> 1.4)
- rspec (2.7.0)
- rspec-core (~> 2.7.0)
- rspec-expectations (~> 2.7.0)
- rspec-mocks (~> 2.7.0)
- rspec-core (2.7.0)
- rspec-expectations (2.7.0)
- diff-lcs (~> 1.1.2)
- rspec-mocks (2.7.0)
+ rspec (2.13.0)
+ rspec-core (~> 2.13.0)
+ rspec-expectations (~> 2.13.0)
+ rspec-mocks (~> 2.13.0)
+ rspec-core (2.13.1)
+ rspec-expectations (2.13.0)
+ diff-lcs (>= 1.1.3, < 2.0)
+ rspec-mocks (2.13.0)
simplecov (0.5.4)
multi_json (~> 1.0.3)
simplecov-html (~> 0.5.3)
View
1  lib/viadeo/helpers/request.rb
@@ -50,6 +50,7 @@ def request(method, path, query, data, options)
if !data.respond_to?(:bytesize) && data.respond_to?(:map)
data = to_query(data)
+ c.headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8'
end
case method
View
6 spec/query_spec.rb
@@ -29,5 +29,11 @@
expect(obj.body.params.param1).to eq('test')
expect(obj.body.params.param2).to eq('body test')
end
+
+ it 'supports unicode' do
+ obj = client.post('/test', {param1: 'test'}, {param2: [116, 233, 115, 116].pack("U*")})
+ expect(obj.body.params.param2).to eq([116, 233, 115, 116].pack("U*"))
+ expect(obj.body.content_type).to eq('application/x-www-form-urlencoded; charset=UTF-8')
+ end
end
end
View
2  spec/support/stub_server.rb
@@ -9,7 +9,7 @@ class DummyStubServer < Sinatra::Base
end
content_type :json
- {method: verb, url: request.fullpath, params: params}.to_json
+ {method: verb, url: request.fullpath, params: params, content_type: request.content_type}.to_json
end
end

No commit comments for this range

Something went wrong with that request. Please try again.