CatalogApi v0.0.13 CatalogApi.Fixture View Source

Provides %HTTPoison.Response{} fixtures of CatalogAPI responses.

These can be used to write tests which ensure that everything is wired up correctly through the CatalogApi package.

Link to this section Summary

Functions

Returns a %HttpPoison.Response{} struct with a 400 status code and a body which contains an error response indicating that the supplied cart_version parameter did not match the current version of the cart

Returns a %HTTPPoison.Response{} struct with a 200 status code and a body which contains a successful response to the cart_add_item method

Returns a %HTTPPoison.Response{} struct with a 200 status code and a body which contains a successful response to the cart_order_place method

Returns a %HTTPPoison.Response{} struct with a 200 status code and a body which contains a successful response to the cart_set_address method

Returns a %HTTPPoison.Response{} struct with a 200 status code and a body which contains a response from CatalogAPI indicating that the shopping cart is empty

Returns a %HTTPPoison.Response{} struct with a 200 status code and a body which contains a response from CatalogAPI indicating that the address did not have a valid address

Returns a %HTTPPoison.Response{} struct with a 200 status code and a body which contains a successful response to the cart_view method

Returns a %HTTPPoison.Response{} struct with a 400 status code and a body which matches the Fault json structure that CatalogApi returns

Returns a %HTTPPoison.Response{} struct with a 500 status code

Returns a %HTTPPoison.Response{} struct with a 400 status code and a body which contains a response to the view_item method indicating that the requested item did not exit

Returns a %HTTPPoison.Response{} struct with a 200 status code and a body which contains a successful response to the search_catalog method

Returns a %HTTPPoison.Response{} struct with a 200 status code and a body which contains a successful response to the view_item method

Link to this section Functions

Link to this function bad_cart_version_fault(as_response \\ true) View Source

Returns a %HttpPoison.Response{} struct with a 400 status code and a body which contains an error response indicating that the supplied cart_version parameter did not match the current version of the cart.

Returns only the body text if passed an argument of false to as_response.

Link to this function cart_add_item_success(as_response \\ true) View Source

Returns a %HTTPPoison.Response{} struct with a 200 status code and a body which contains a successful response to the cart_add_item method.

Returns only the body text if passed an argument of false to as_response.

Link to this function cart_order_place_success(as_response \\ true) View Source

Returns a %HTTPPoison.Response{} struct with a 200 status code and a body which contains a successful response to the cart_order_place method.

Returns only the body text if passed an argument of false to as_response.

Link to this function cart_set_address_success(as_response \\ true) View Source

Returns a %HTTPPoison.Response{} struct with a 200 status code and a body which contains a successful response to the cart_set_address method.

Returns only the body text if passed an argument of false to as_response.

Link to this function cart_view_empty_cart_success(as_response \\ true) View Source

Returns a %HTTPPoison.Response{} struct with a 200 status code and a body which contains a response from CatalogAPI indicating that the shopping cart is empty.

Returns only the body text if passed an argument of false to as_response.

Link to this function cart_view_no_address_success(as_response \\ true) View Source

Returns a %HTTPPoison.Response{} struct with a 200 status code and a body which contains a response from CatalogAPI indicating that the address did not have a valid address.

Returns only the body text if passed an argument of false to as_response.

Link to this function cart_view_success(as_response \\ true) View Source

Returns a %HTTPPoison.Response{} struct with a 200 status code and a body which contains a successful response to the cart_view method.

Returns only the body text if passed an argument of false to as_response.

Returns a %HTTPPoison.Response{} struct with a 400 status code and a body which matches the Fault json structure that CatalogApi returns.

Returns only the body text if passed an argument of false to as_response.

Link to this function internal_error() View Source
internal_error() :: HTTPoison.Response.t()

Returns a %HTTPPoison.Response{} struct with a 500 status code.

Link to this function no_item_fault(as_response \\ true) View Source
no_item_fault(boolean()) :: String.t() | HTTPoison.Response.t()

Returns a %HTTPPoison.Response{} struct with a 400 status code and a body which contains a response to the view_item method indicating that the requested item did not exit

Returns only the body text if passed an argument of false to as_response.

Link to this function search_catalog_success(as_response \\ true) View Source
search_catalog_success(boolean()) :: String.t() | HTTPoison.Response.t()

Returns a %HTTPPoison.Response{} struct with a 200 status code and a body which contains a successful response to the search_catalog method.

Returns only the body text if passed an argument of false to as_response.

Link to this function view_item_success(as_response \\ true) View Source
view_item_success(boolean()) :: String.t() | HTTPoison.Response.t()

Returns a %HTTPPoison.Response{} struct with a 200 status code and a body which contains a successful response to the view_item method.

Returns only the body text if passed an argument of false to as_response.