Skip to content

Commit

Permalink
Merge pull request #2508 from tvdeyen/6.1-fix-element-with-warning
Browse files Browse the repository at this point in the history
[6.1] Allow to create element with warning in definition
  • Loading branch information
tvdeyen authored Jun 30, 2023
2 parents 8cf71ee + e9f2ef4 commit 93cd7ca
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/models/alchemy/element.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class Element < BaseRecord
"compact",
"message",
"deprecated",
"warning",
].freeze

# All Elements that share the same page version and parent element and are fixed or not are considered a list.
Expand Down
3 changes: 3 additions & 0 deletions spec/dummy/config/alchemy/elements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,3 +299,6 @@
- name: key_words
type: EssenceText
group: details

- name: element_with_warning
warning: "Do not use this element!"
10 changes: 10 additions & 0 deletions spec/models/alchemy/element_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,16 @@ module Alchemy
end
end
end

context "with warning in definition" do
let(:element) do
Alchemy::Element.new(name: "element_with_warning")
end

it "creates element" do
expect { element.save }.to_not raise_error
end
end
end

describe ".dom_id_class" do
Expand Down

0 comments on commit 93cd7ca

Please sign in to comment.