changed card and section style to active_yaml (because of entanglement :-)

This commit is contained in:
2022-12-10 20:29:31 +02:00
parent d936fc05ab
commit 04e189f913
16 changed files with 51 additions and 70 deletions

View File

@ -2,12 +2,16 @@ require 'rails_helper'
module Merged
RSpec.describe CardStyle, type: :model do
let(:first_card) {Style.cards.first}
let(:first_card) {CardStyle.all.first}
it "has Style.cards" do
expect(CardStyle.cards.class).to be Hash
expect(CardStyle.cards.length).to be 5
it "has .all" do
expect(CardStyle.all.length).to be 5
end
it "has fields" do
expect(first_card.fields.class).to be Array
expect(first_card.fields.length).to be 2
expect(first_card.fields.first).to eq "header"
end
end
end

View File

@ -2,18 +2,17 @@ require 'rails_helper'
module Merged
RSpec.describe SectionStyle, type: :model do
let(:first_section) {SectionStyle.sections.first}
let(:first_section) {SectionStyle.all.first}
it "has Style.sections" do
expect(SectionStyle.sections.class).to be Hash
expect(SectionStyle.sections.length).to be 7
expect(SectionStyle.all.length).to be 7
end
it "Finds section by template" do
spacer = SectionStyle.sections["section_spacer"]
spacer = SectionStyle.find_by_template("section_spacer")
expect(spacer).not_to eq nil
end
it "Spacer has no fields" do
spacer = SectionStyle.sections["section_spacer"]
spacer = SectionStyle.find_by_template("section_spacer")
expect(spacer.fields).to be nil
end