From a32d676ddcd36d4e1a7b561094a4398ce809068f Mon Sep 17 00:00:00 2001 From: Faheem Date: Fri, 10 Jan 2020 12:10:36 +0000 Subject: [PATCH] Fix documentation for authentication in mock adapter Mock adapter was only accepting test as username and password. However documentation was directing to configure them differently. Fixed so that both are same now --- README.md | 2 +- lib/shopify/adapters/mock.ex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b361a9d..c9f2d85 100644 --- a/README.md +++ b/README.md @@ -235,7 +235,7 @@ Lets say you have a test config file in `your_project/config/test.exs` and tests config :shopify, [ shop_name: "test", api_key: "test-key", - password: "test-paswword", + password: "test-password", client_secret: "test-secret", client_adapter: Shopify.Adapters.Mock, # Use included Mock adapter fixtures_path: Path.expand("../test/fixtures/shopify", __DIR__) # Use fixures in this directory diff --git a/lib/shopify/adapters/mock.ex b/lib/shopify/adapters/mock.ex index 070c92e..7a29c21 100644 --- a/lib/shopify/adapters/mock.ex +++ b/lib/shopify/adapters/mock.ex @@ -84,7 +84,7 @@ defmodule Shopify.Adapters.Mock do def basic_auth(request) do case URI.parse(request.full_url) do - %URI{userinfo: "test:test"} -> {:passed, request} + %URI{userinfo: "test-key:test-password"} -> {:passed, request} %URI{userinfo: _} -> {:failed, request} end end