Skip to content

Commit bc36520

Browse files
committed
fixed provider instance specification doesn't set description
1 parent 4004f8d commit bc36520

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

lib/diffo/provider/components/instance/extension/specification.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ defmodule Diffo.Provider.Instance.Specification do
1212
@doc """
1313
Struct for a Specification
1414
"""
15-
defstruct [:id, :name, :type, :major_version, :category]
15+
defstruct [:id, :name, :type, :major_version, :description, :category]
1616

1717
@doc """
1818
Sets the specified_by argument in the changeset, ensuring the Extended Instance's specification exists

test/instance_extension/specification_test.exs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ defmodule Diffo.InstanceExtension.SpecificationTest do
66
@moduledoc false
77
use ExUnit.Case
88
alias Diffo.Test.Servo
9+
alias Diffo.Test.Shelf
910

1011
setup_all do
1112
AshNeo4j.BoltyHelper.start()
@@ -23,5 +24,15 @@ defmodule Diffo.InstanceExtension.SpecificationTest do
2324
%Ash.Error.Invalid{errors: errors} = error
2425
assert hd(errors).message == "must be a uuid v4 or nil"
2526
end
27+
28+
test "description declared in specification DSL roundtrips to the persisted specification" do
29+
spec_id = Shelf.specification()[:id]
30+
description = Shelf.specification()[:description]
31+
32+
Servo.build_shelf(%{name: "s"})
33+
34+
{:ok, specification} = Diffo.Provider.get_specification_by_id(spec_id)
35+
assert specification.description == description
36+
end
2637
end
2738
end

0 commit comments

Comments
 (0)