fix new menthods
This commit is contained in:
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user