test"all resources are shown when :* option is selected",_do
defmoduleDomaindo
@moduledocfalse
useAsh.Domain,
extensions:[AshAdmin.Domain]
admindo
show?true
show_resources:*
end
resourcesdo
resourceAshAdmin.Test.Post
resourceAshAdmin.Test.Comment
end
end
assertAshAdmin.Domain.show_resources(Domain)===[
AshAdmin.Test.Post,
AshAdmin.Test.Comment
]
end
test"selected resources are shown",_do
defmoduleDomaindo
@moduledocfalse
useAsh.Domain,
extensions:[AshAdmin.Domain]
admindo
show?true
show_resourcesAshAdmin.Test.Post
end
resourcesdo
resourceAshAdmin.Test.Post
resourceAshAdmin.Test.Comment
end
end
assertAshAdmin.Domain.show_resources(Domain)===[
AshAdmin.Test.Post
]
end
test"if shown resrouces option not eixsting resource providede error",_do
assert_raise(Spark.Error.DslError,"[AshAdmin.Test.AshAdminTest.Domain]\n admin -> show_resources:\n SomeRandom is not a valid resource in AshAdmin.Test.AshAdminTest.Domain",fn->