store all data in memory in preperarion for shallow routes

This commit is contained in:
2022-11-30 13:21:06 +02:00
parent 277d4dce36
commit 1d91ff2fc6
14 changed files with 149 additions and 57 deletions

View File

@ -2,6 +2,13 @@ require 'rails_helper'
module Merged
RSpec.describe Card, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
let(:first) {Card.all.values.first}
it "has Card.all" do
expect(Card.all.class).to be Hash
end
it "has cards" do
expect(first.class).to be Card
end
end
end

View File

@ -0,0 +1,17 @@
require 'rails_helper'
module Merged
RSpec.describe Image, type: :model do
let(:first) {Image.all.values.first}
it "has Pages.all" do
expect(Image.all.class).to be Hash
end
it "has image" do
expect(first.class).to be Image
end
it "image has name" do
expect(first.name).to eq "large"
end
end
end

View File

@ -0,0 +1,17 @@
require 'rails_helper'
module Merged
RSpec.describe Page, type: :model do
let(:index) {Page.find('index')}
it "has Pages.all" do
expect(Page.all.class).to be Hash
end
it "has index page" do
expect(index.class).to be Page
end
it "has sections" do
expect(index.sections.length).to be 1
end
end
end

View File

@ -0,0 +1,17 @@
require 'rails_helper'
module Merged
RSpec.describe Section, type: :model do
let(:first) {Section.all.values.first}
it "has Sections.all" do
expect(Section.all.class).to be Hash
end
it "has index page" do
expect(first.class).to be Section
end
it "has sections" do
expect(first.cards.length).to be 2
end
end
end