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

Fix problem with undefined status code method for Rack::MockResponse #20

Merged
merged 1 commit into from
Nov 16, 2014
Merged

Fix problem with undefined status code method for Rack::MockResponse #20

merged 1 commit into from
Nov 16, 2014

Conversation

grzesiek
Copy link
Contributor

Hi.

This patch fixes problem for expect_status Airborne DSL method.

When used with Rack application, expect_status compares status code passed to that method with value returned by response.code method. That method does not exist in Rack::MockRequest.

https://github.com/brooklynDev/airborne/blob/master/lib/airborne/request_expectations.rb#L34

There is status method in Rack::MockRequest instead.

This commit adds method code that is alias for status in Rack::MockResponse

Kind regards,
Grzegorz

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) when pulling 05bf398 on grzesiek:rack-response-fix into e3d75dc on brooklynDev:master.

@grzesiek
Copy link
Contributor Author

Or maybe define_singleton_method would be better here ?

brooklynDev added a commit that referenced this pull request Nov 16, 2014
Fix problem with undefined status code method for Rack::MockResponse
@brooklynDev brooklynDev merged commit 38f636f into brooklynDev:master Nov 16, 2014
@brooklynDev
Copy link
Owner

Good catch! We don't actually have enough tests for Rack applications, and that's probably how this one got through. I merged your PR, and I'll try to flesh out the test suite for Rack apps. (Unless if you want to 😄 )

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