anchor.diff:      ct:pal("~p", [Description]),
       itest_cookbook_util:cookbook_setup(AllCookbooks),
       FullEnvironment = environment_from_spec(EnvironmentSpec),
  -    add_environment_to_db(FullEnvironment),
  -
  -    EnvName = FullEnvironment#chef_environment.name,
  +    create_record(FullEnvironment),
  +    {ok, PersistedEnvironment} = fetch_record(FullEnvironment),
  +
       lists:map(fun({CookbookName, NumToVersions}) ->
                         lists:map(fun({NumVersions, Versions}) ->
                                           {ok, Actual} = chef_sql:fetch_environment_filtered_cookbook_versions(itest_util:the_org_id(),
  -                                                                                                             EnvName, CookbookName,
  +                                                                                                             PersistedEnvironment, CookbookName,
                                                                                                                NumVersions),
                                           ?assertEqual([{CookbookName, Versions}], Actual)
                                   end,
  
positive.code: 
  environment_filtered_cookbooks_spec() ->
      [
       {"no environment constraints",
        <<"testing">>,
        [{<<"cookbook_one">>, [{0, []},
                               {1, [<<"3.0.0">>]},
  
negative.code:               end,
                ResultsSpec),
      itest_cookbook_util:remove_all_cookbooks(),
      delete_record(FullEnvironment).
  
  environment_cookbooks_specs() ->
      [
       {"[environment cookbooks] multiple cookbooks, no environment constraints, one version",
        <<"testing">>,
        1,
        [{<<"cookbook_one">>, [<<"3.0.0">>]},
  