You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Amazon Product API "ItemLookup" endpoint (#173)
* Refactor AmazonProductAPI
In preparation for #62, this commit pulls the endpoint-specific
information out of the HTTPClient class and into and endpoint-specific
class.
Now HTTPClient is responsible only for managing the environment
information and directing the user to the relevant endpoint. Adding a
new endpoint is as simple as adding a method (ex. `item_search`) and
corresponding class (ex. `ItemSearchEndpoint).
The interface is *not* in its final form yet. This is just a good
breaking point for a commit.
* Add ItemSearch endpoint
Building on the last commit, this adds a new ItemLookup endpoint. Now we
can pull details on an individual item based on the ASIN.
The endpoints and responses include a lot of duplication. Some
refactoring will probably be needed.
* Extract spec for ItemSearchEndpoint
When the item search endpoint was extracted, the specs weren't extracted
with it; this means that the HTTPClientSpec was testing everything
relating to the item search endpoint.
This commit extracts all specs relating to the endpoint into a new file.
This can now be refactored and copied over for the
`ItemLookupEndpointSpec`.
* Add spec for ItemLookupEndpoint
* Fix CodeClimate issue
This is a bit of a hack solution, but I don't feel comfortable doing any
major abstraction here yet; I don't think we have enough information.
Hopefully this'll clear up the CodeClimate complaints about duplicated
code!
* Fix easy PR-related rubocop issues
Two big points:
1. This only fixes easy rubocop issues related to this PR. This
doesn't touch any of the new capistrano code; I want the diff for
this PR to be fairly contained.
2. This includes two rubocop config changes:
i. Exclude the vendor directory from linting
ii. Allow multiline braces in tests (for exception checks, let, etc.)
There are a few more risky/controversial rubocop changes I omitted from
this commit. Those are coming next.
* Fix all Lint/UriEscapeUnescape violations
Fixes#56
This commit changes all the `URI.escape` calls to `CGI.escape`. All
tests pass and the app still works. As a bonus, this seems to resolve
issue #56 too-apostrophes are now properly escaped.
This resolves all rubocop issues relating to this PR.
* Give better name to AWS test credentials in specs
Following the review suggestions. This renames `env` to
`aws_credentials`. The latter is a better name because it represents a
credentials object (built from env vars), not the ENV object itself.
Hopefully this will be clearer!
* Fix item lookup hash
When I fixed the code style for Code Climate in #173, I used the wrong
hash leading to no update attributes being found. This fixes the bug,
adds a test, and renames some of the variables.
0 commit comments