File tree Expand file tree Collapse file tree 2 files changed +0
-25
lines changed
Expand file tree Collapse file tree 2 files changed +0
-25
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments