anchor.diff:  -include_lib("eunit/include/eunit.hrl").
   
   -export([
  -          fetch_org_id/1,
  -          fetch_org_id/2
  +          fetch_org_id/1
           ]).
   
   %% @doc Fetch an org_id by querying opscode-account organizations endpoint
  
positive.code:             throw({error, Reason})
      end.
  
  path(OrgName) ->
      {ok, ErchefHost} = application:get_env(pushy, erchef_root_url),
      ErchefHost ++ "/organizations/" ++ OrgName.
  
  %%
  %% Internal functions
  
negative.code: -spec fetch_org_id(OrgName :: string()) -> binary() | not_found.
  fetch_org_id(OrgName) ->
      {ok, Key} = chef_keyring:get_key(pivotal),
      Path = path(OrgName),
      Headers =  chef_authn:sign_request(Key, <<"">>, "pivotal",
                                         <<"GET">>, now,
                                         list_to_binary(Path)),
      FullHeaders = [{"Accept", "application/json"}|Headers],
      fetch_org_id(OrgName, FullHeaders).
  
  fetch_org_id(OrgName, Headers) ->
      Url = url(OrgName),
      case ibrowse:send_req(Url, Headers, get) of
          {ok, "404", _ResponseHeaders, _ResponseBody} ->
              not_found;
          {ok, Code, ResponseHeaders, ResponseBody} ->
  