starting on page styles aka types
This commit is contained in:
parent
2144f8a0f6
commit
c2acfacc26
8
app/models/merged/page_style.rb
Normal file
8
app/models/merged/page_style.rb
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
module Merged
|
||||||
|
class PageStyle < ActiveYaml::Base
|
||||||
|
set_root_path Engine.root + "config"
|
||||||
|
|
||||||
|
fields :type , :description
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
@ -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'
|
|
4
config/merged/page_styles.yml
Normal file
4
config/merged/page_styles.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
- type: page
|
||||||
|
description: A general page, may contain anykind of section.
|
||||||
|
No restrictions of any kind. No options either.
|
19
spec/models/merged/page_style_spec.rb
Normal file
19
spec/models/merged/page_style_spec.rb
Normal 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
|
Loading…
Reference in New Issue
Block a user