fix new menthods

This commit is contained in:
2022-12-12 14:28:57 +02:00
parent 60b270786c
commit 0d1adab3f3
5 changed files with 44 additions and 29 deletions

View File

@ -41,5 +41,16 @@ module Merged
Section.reload
expect{Page.find(id) }.to raise_error(ActiveHash::RecordNotFound)
end
it "creates simple section" do
s = index.new_section("section_spacer")
expect(s).not_to be nil
expect(s.template).to eq "section_spacer"
end
it "creates page" do
name = "randomname"
page = Page.new_page( name)
expect(page.name).to eq name
end
end
end

View File

@ -45,6 +45,11 @@ module Merged
expect(last.next_section).to be nil
end
it "creates new spacer section" do
s = Section.new_section("section_spacer" , 1 , 1)
expect(s.template).to eq "section_spacer"
end
it "deletes " do
last_id = last.id
last.delete

View File

@ -4,6 +4,11 @@ module Merged
RSpec.describe SectionStyle, type: :model do
let(:first_section) {SectionStyle.all.first}
it "finds stye" do
spacer = SectionStyle.find_by_template("section_spacer")
expect(spacer).not_to be nil
end
it "has Style.sections" do
expect(SectionStyle.all.length).to be 7
end
@ -15,6 +20,9 @@ module Merged
spacer = SectionStyle.find_by_template("section_spacer")
expect(spacer.fields).to be nil
end
it "Spacer has no fields" do
spacer = SectionStyle.find_by_template("section_spacer")
expect(spacer.fields).to be nil
end
end
end