#!perl
use strict; use warnings;
-use Test::More tests => 5;
+use Test::More tests => 5; # TODO add the right number of tests
use OpenILS::Utils::TestUtils;
use OpenILS::Utils::CStoreEditor qw/:funcs/;
use OpenILS::Application::AppUtils;
is(scalar(@$results), 0, 'Successfully deleted bre');
+# --------------------------------------------------------------------------
+# 3. Let's attach an existing item record entry to course #1, then delete it
+# --------------------------------------------------------------------------
+
+my $acmcm = Fieldmapper::asset::course_module_course_materials->new;
+$acmcm->course(1);
+$acmcm->id(9999);
+$acmcm->record(55);
+$acmcm->item(); # TODO add a value
+$acmcm->original_status(); # TODO add a status
+$acmcm->original_location(); # TODO add a location
+$acmcm->temporary_record(0);
+$e->create_asset_course_module_course_materials( $acmcm ); # associated this bib record with a course
+$e->commit;
+
+$apputils->simplereq('open-ils.courses', 'open-ils.courses.detach_material', $authtoken, 9999);
+
+my $results = $e->search_asset_course_module_course_materials({id => 9999}); #TODO fetch the acp
+is(scalar(@$results), 0, 'Successfully deleted acmcm'); #TODO check the acp status and location
+
+
+