Skip to content

Commit fe838e1

Browse files
committed
WIP pr comments
1 parent fd34a41 commit fe838e1

3 files changed

Lines changed: 3 additions & 16 deletions

File tree

lib/intelligent_foods/api_client.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ def execute_request(request:, uri:, body: nil,
3434
end
3535
end
3636

37-
def build_patch_request(uri:, body:)
38-
build_request_with_body(uri: uri, body: body,
39-
http_method: Net::HTTP::Patch)
40-
end
41-
4237
def build_request_with_body(uri:, body:, http_method: Net::HTTP::Post)
4338
request = http_method.new(uri)
4439
request.body = body.to_json

lib/intelligent_foods/resources/order.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ def cancel!
4747

4848
def update!
4949
uri = URI("#{IntelligentFoods.base_url}/order/#{id}")
50-
request = client.build_patch_request(uri: uri, body: update_request_body)
50+
request = client.build_request_with_body(uri: uri,
51+
body: update_request_body,
52+
http_method: Net::HTTP::Patch)
5153
response = client.execute_request(request: request, uri: uri)
5254
if response.success?
5355
Order::build_from_response(response.data)

spec/intelligent_foods/api_client_spec.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,6 @@
164164
end
165165
end
166166

167-
describe "#build_patch_request" do
168-
it "builds a request using the Patch HTTP method" do
169-
client = IntelligentFoods::ApiClient.new(id: "id", secret: "secret")
170-
171-
result = client.build_patch_request(uri: "test.com", body: {})
172-
173-
expect(result.method).to eq("PATCH")
174-
end
175-
end
176-
177167
describe "#authenticated?" do
178168
it "is not authenticated" do
179169
client = IntelligentFoods::ApiClient.new(id: "id", secret: "secret")

0 commit comments

Comments
 (0)