-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
PR for issue #1578 #1579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR for issue #1578 #1579
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1149,6 +1149,39 @@ def memoized | |
end | ||
end | ||
|
||
describe 'delete 200, with a return value (no explicit body)' do | ||
it 'responds to /example delete method' do | ||
subject.send(:delete, '/example', anchor: false) do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think you need to |
||
'deleted' | ||
end | ||
send(:delete, '/example/') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same, just |
||
expect(last_response.status).to eql 200 | ||
expect(last_response.body).not_to be_empty | ||
end | ||
end | ||
|
||
describe 'delete 204, with nil has return value (no explicit body)' do | ||
it 'responds to /example delete method' do | ||
subject.send(:delete, '/example', anchor: false) do | ||
nil | ||
end | ||
send(:delete, '/example/') | ||
expect(last_response.status).to eql 204 | ||
expect(last_response.body).to be_empty | ||
end | ||
end | ||
|
||
describe 'delete 204, with empty array has return value (no explicit body)' do | ||
it 'responds to /example delete method' do | ||
subject.send(:delete, '/example', anchor: false) do | ||
'' | ||
end | ||
send(:delete, '/example/') | ||
expect(last_response.status).to eql 204 | ||
expect(last_response.body).to be_empty | ||
end | ||
end | ||
|
||
describe 'all other' do | ||
%w(post get head put options patch).each do |verb| | ||
it "allows for the anchoring option with a #{verb.upcase} method" do | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe
body
here is the same as@body
, so this should befile || body
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's the same. I forgot to remove it. On it 👍
Thanks