Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I introduced a
stub_request
method to simplify the fixture loading and method expectations. I also moved the message expectations out of the subject block and into a before filter, since I believe expectations do not belong in a subject block.This simplifies this
to this
which I believe is more readable. It also has the added benefit of making changing the tests easier if you ever decide to use a different http library.
The http GET verb is hard-coded into
stub_request
, but the API is currently does not, and is unlikely to ever, use any other http verb.I changed the name of the
getbyid-team
fixture toget-team-by-id
, to be consistent withget-summoner-by-name
andget-champion-by-id
, etc. This also makes the above simplifications possible.I also moved the spec helper methods previously defined in
spec_helper
into a module insupport/helpers
. The makes thespec_helper
file less cluttered. The two files namedhelpers
andmodel_helpers
may be confusing; if you can think of any better names I'll change them.There are a few other, mainly cosmetic/structural, changes that I made to the request specs.
If there is anything you don't agree with, I'd be happy to discuss/revert it :)