       assert {:error, :slot_already_linked} === MotherboardSlotController.link(slot.slot_id, component.component_id)
     end
 
-    test "failure when component is already used", context0 do
-       {:ok, keywords} = create_motherboard(context0)
+    test "failure when component is already used", context do
+      %{slot: slot0, spec: spec, mobo_type: mobo_type} = context
+      {:ok, slot1, _} = create_motherboard(mobo_type, spec.spec_code)
 
-       slot0 = context0.slot
-       slot1 = Keyword.get(keywords, :slot)
        component = component_for(slot0)
        MotherboardSlotController.link(slot0.slot_id, component.component_id)
 

      spec: spec]
  end

  setup [:create_motherboard]

  defp create_motherboard(context) do
    comp_params = %{
      component_type: context.mobo_type,
      spec_id: context.spec.spec_id}

      MotherboardSlotController.find_by(motherboard_id: mobo.motherboard_id)
      |> List.first()

    {:ok, slot, mobo}
  end

  defp component_type(name) do
