-
Notifications
You must be signed in to change notification settings - Fork 13
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
Check forbidden cacheability #6
Check forbidden cacheability #6
Conversation
Let users explicitly check the return code
So we can check for an unsuccessful response
Sometimes this is expected
I have a spec failure:
But digging into this failure I believe it's not caused by my changes, simple unmasking a failure that was somehow masked. This is probably because your matchers are returning RuntimeErrors rather than false (see #5), but I can't figure out where this issue lies. Also the |
otherwise continue with further checks. Rather than assuming success if this check succeeds, which causes a failure of 'should fail on 300 and correct origin' test.
The error claims a match is not found, but the match is not done in this method, it's within the be_served_from_origin matcher. It fails if the header exists? Any successful tests were masked until the previous commit
Wow that syntax was confusing
This is how a matcher should behave
Let RSpec raise an exception
This just makes this code more confusing...
And ensure the response code is successful
Simplifying and removing abstractions reduces code count and complexity significantly.
Ok, I've significantly refactored the |
Thanks for the PR, I'll review it at some point over this weekend. |
Thanks, the x_cache stuff is so much clearer now! |
Check forbidden cacheability
There is a good use case for checking a page is both forbidden and not cacheable. (Steam could do with something like this :P)
We shouldn't be checking the response code inside the
not_be_cached
matcher, instead we should be chaining matchers together if required. This PR introduces this functionality, so you are able to do: