Skip to content

Commit

Permalink
fixing test invocations where it was supposed to have two args
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermesilveira committed Oct 19, 2010
1 parent b277a63 commit ad8262f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
5 changes: 3 additions & 2 deletions lib/restfulie/client/http/request_marshaller.rb
Expand Up @@ -21,16 +21,17 @@ def parse(host, path, http_request, request, response)
elsif @config.raw?
response
elsif (!response.body.nil?) && !response.body.empty?
representation = RequestMarshaller.content_type_for(response.headers['content-type'])
representation ||= Restfulie::Common::Representation::Generic.new
representation = RequestMarshaller.content_type_for(response.headers['content-type']) || Restfulie::Common::Representation::Generic.new
representation.unmarshal(response.body).tap do |u|
u.extend(ResponseHolder)
u.response = response
u
end
else
response.tap do |resp|
resp.extend(ResponseHolder)
resp.response = response
resp
end
end
end
Expand Down
18 changes: 9 additions & 9 deletions tests/spec/requests/http/adapter_spec.rb
Expand Up @@ -10,39 +10,39 @@
end

it "should get and respond 200 code" do
@client.at("/test").get.should respond_with_status(200)
@client.at("/test").get.response.code.should == 200
end

it "should put and respond 200 code" do
@client.at("/test").put("test").should respond_with_status(200)
@client.at("/test").put("test").response.code.should == 200
end

it "should delete and respond 200 code" do
@client.at("/test").delete.should respond_with_status(200)
@client.at("/test").delete.response.code.should == 200
end

it "should head and respond 200 code" do
@client.at("/test").head.should respond_with_status(200)
@client.at("/test").head.response.code.should == 200
end

it "should get! and respond 200 code" do
@client.at("/test").get!.should respond_with_status(200)
@client.at("/test").get!.response.code.should == 200
end

it "should post! and respond 201 code" do
@client.at("/test", "test").post!.should respond_with_status(201)
@client.at("/test").post!("test").should respond_with_status(201)
end

it "should put! and respond 200 code" do
@client.at("/test", "test").put!.should respond_with_status(200)
@client.at("/test").put!("test").response.code.should == 200
end

it "should delete! and respond 200 code" do
@client.at("/test").delete!.should respond_with_status(200)
@client.at("/test").delete!.response.code.should == 200
end

it "should head! and respond 200 code" do
@client.at("/test").head!.should respond_with_status(200)
@client.at("/test").head!.response.code.should == 200
end

end
Expand Down

0 comments on commit ad8262f

Please sign in to comment.