changed card and section style to active_yaml (because of entanglement :-)
This commit is contained in:
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user