Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add spec for content type

  • Loading branch information...
commit 9da3b84b776c7036f15a99d588069a0d49cf1e51 1 parent f49e16a
@dbussink authored
Showing with 13 additions and 0 deletions.
  1. +13 −0 spec/jsonrpc_spec.rb
View
13 spec/jsonrpc_spec.rb
@@ -43,10 +43,19 @@ def self.raw_post_path
@raw_post_path
end
+ def self.raw_headers=(headers)
+ @raw_headers = headers
+ end
+
+ def self.raw_headers
+ @raw_headers
+ end
+
def post(path, body, headers = [])
res = Net::HTTPSuccess.new('1.2', '200', 'OK')
self.class.raw_post_path = path
self.class.raw_post_body = body
+ self.class.raw_headers = headers
res.body = self.class.raw_response_data
res
end
@@ -76,6 +85,10 @@ def post(path, body, headers = [])
@result.should == {"result" => 200, "message" => "what a great success!"}
end
+ it 'should set the headers to application/json' do
+ Net::HTTP.raw_headers.should include("Content-Type" => "application/json")
+ end
+
end
describe 'when it is not successful' do
Please sign in to comment.
Something went wrong with that request. Please try again.