Skip to content

Commit c9835c0

Browse files
committed
Remove delete
1 parent 31055c9 commit c9835c0

File tree

2 files changed

+0
-25
lines changed

2 files changed

+0
-25
lines changed

lib/cortex/request.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,6 @@ def delete(path)
3333
parse_response(response)
3434
end
3535

36-
def delete!(path)
37-
response = connection.delete do |r|
38-
r.url base_url + path
39-
end
40-
if response.status < 300
41-
true
42-
else
43-
false
44-
end
45-
end
46-
4736
def save(path, model)
4837
model[:id] ? put("#{path}/#{model[:id]}", model) : post(path, model)
4938
end

spec/request_spec.rb

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,6 @@
4141
end
4242
end
4343

44-
describe '#delete!' do
45-
it 'should be true when status is under 300' do
46-
@connection.stubs(:delete).returns(response).once
47-
expect(client.delete!('/test/')).to be_truthy
48-
end
49-
50-
it 'should be false when status is over 300' do
51-
error = response
52-
error.status = 403
53-
@connection.stubs(:delete).returns(error).once
54-
expect(client.delete!('/test/')).to be_falsey
55-
end
56-
end
57-
5844
describe '#save' do
5945
it 'should post when new' do
6046
@connection.stubs(:post).returns(response).once

0 commit comments

Comments
 (0)