Skip to content

Commit

Permalink
Specs now pass. All were failing due to mock weirdness.
Browse files Browse the repository at this point in the history
  • Loading branch information
bguthrie committed Nov 23, 2009
1 parent 8331fd3 commit 417c533
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion spec/restfulie_spec.rb
Expand Up @@ -262,7 +262,7 @@ def prepare_http_for(request)
end
end

it "should allow method overriding" do
it "should allow method overriding for methods given as symbols" do
model = RestfulieModel.from_xml xml_for('update')

req = mock Net::HTTP::Delete
Expand All @@ -273,6 +273,17 @@ def prepare_http_for(request)
res.should eql(expected_response)
end

it "should allow method overriding for methods given as strings" do
model = RestfulieModel.from_xml xml_for('update')

req = mock Net::HTTP::Delete
Net::HTTP::Delete.should_receive(:new).with('/order/1').and_return(req)

expected_response = prepare_http_for(req)
res = model.send :update, :method => "delete"
res.should eql(expected_response)
end

it "should GET and return its content" do
model = RestfulieModel.from_xml xml_for('check_info')
req = mock Net::HTTP::Get
Expand Down

0 comments on commit 417c533

Please sign in to comment.