Skip to content
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

Merged
merged 4 commits into from
Feb 19, 2017
Merged

PR for issue #1578 #1579

merged 4 commits into from
Feb 19, 2017

Conversation

ericproulx
Copy link
Contributor

@ericproulx ericproulx commented Feb 19, 2017

Closes #1578 and #1572

@dblock
Copy link
Member

dblock commented Feb 19, 2017

I think this is the same as #1572, and we've been wanting a fix, right?

@@ -265,7 +265,10 @@ def run
run_filters afters, :after
cookies.write(header)

# The Body commonly is an Array of Strings, the application instance itself, or a File-like object.
#status verifies body presence when DELETE
@body ||= response_object if response_object.present?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the if is redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, i'll remove it

@dblock
Copy link
Member

dblock commented Feb 19, 2017

Run rubocop -a then rubocop --auto-gen-config to cleanup whatever rubocop is unhappy about.

Added rubocop_todo
# status verifies body presence when DELETE
@body ||= response_object

# The Body commonly is an Array of Strings, the application instance itself, or a File-like object
response_object = file || [body || response_object]
Copy link
Member

@dblock dblock Feb 19, 2017

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 be file || body?

Copy link
Contributor Author

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

@@ -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
Copy link
Member

@dblock dblock Feb 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need to send these, delete is public, so subject.delete .... I could be wrong.

subject.send(:delete, '/example', anchor: false) do
'deleted'
end
send(:delete, '/example/')
Copy link
Member

@dblock dblock Feb 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, just delete '/example', these are rack helpers. This one I am pretty sure can be done without a send.

@dblock
Copy link
Member

dblock commented Feb 19, 2017

You need a CHANGELOG and it's good to go. Say that it fixes #1572.

@dblock dblock merged commit 3959a01 into ruby-grape:master Feb 19, 2017
@dblock
Copy link
Member

dblock commented Feb 19, 2017

Merged, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants