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

Allow all Fixnum statuses #953

Merged
merged 2 commits into from
Mar 10, 2015

Conversation

dabrorius
Copy link
Contributor

This is a fixup for #952
I didn't edit changelog because #952 change description still seems valid.

@dblock
Copy link
Member

dblock commented Mar 10, 2015

@dm1try Double-check this for me please? Merge at will.

@dblock
Copy link
Member

dblock commented Mar 10, 2015

@dabrorius I think we need an explicit test for being able to set a status to a value not in that Rack list.

@@ -118,11 +118,6 @@ def initialize
.to raise_error(ArgumentError, 'Status code :foo_bar is invalid.')
end

it 'raises error if unknow status code is passed' do
expect { subject.status 210 }
.to raise_error(ArgumentError, 'Status code 210 is invalid.')
Copy link
Member

Choose a reason for hiding this comment

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

So this test should be here, but assert the opposite, .to_not raise_error ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I thought we will just pretend like that feature never existed :)

expect { subject.status 210 }
.to raise_error(ArgumentError, 'Status code 210 is invalid.')
it 'accepts unknown Fixnum status codes' do
expect { subject.status 210 }.to_not raise_error
Copy link
Member

Choose a reason for hiding this comment

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

Can I be annoying? I think we also need an integration level test that says an endpoint actually returns this status. Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I'll see what I can do.

@dabrorius
Copy link
Contributor Author

@dblock I added few integration specs. Let me know if that's what you had in mind.

@dblock
Copy link
Member

dblock commented Mar 10, 2015

Good. Will merge on 📗

dm1try added a commit that referenced this pull request Mar 10, 2015
@dm1try dm1try merged commit cf4aac1 into ruby-grape:master Mar 10, 2015
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.

3 participants