starting on page styles aka types

This commit is contained in:
Torsten 2022-12-16 10:58:26 +02:00
parent 2144f8a0f6
commit c2acfacc26
4 changed files with 31 additions and 10 deletions

View File

@ -0,0 +1,8 @@
module Merged
class PageStyle < ActiveYaml::Base
set_root_path Engine.root + "config"
fields :type , :description
end
end

View File

@ -1,10 +0,0 @@
= form_for @merged_section do |f|
- if @merged_section.errors.any?
#error_explanation
%h2= "#{pluralize(@merged_section.errors.count, "error")} prohibited this merged_section from being saved:"
%ul
- @merged_section.errors.full_messages.each do |message|
%li= message
.actions
= f.submit 'Save'

View File

@ -0,0 +1,4 @@
---
- type: page
description: A general page, may contain anykind of section.
No restrictions of any kind. No options either.

View File

@ -0,0 +1,19 @@
require 'rails_helper'
module Merged
RSpec.describe PageStyle, type: :model do
let(:first) {PageStyle.all.first}
it "finds stye" do
spacer = PageStyle.find_by_type("page")
expect(spacer).not_to be nil
end
it "has Style.sections" do
expect(PageStyle.all.length).to be 1
end
it "Spacer has no fields" do
expect(first.description).not_to be nil
end
end
end