show page for pages (a start)
This commit is contained in:
@ -6,7 +6,7 @@ module Merged
|
||||
let(:first) {Card.first}
|
||||
|
||||
it "has Card.all" do
|
||||
expect(Card.all.length).to be 46
|
||||
expect(Card.all.length).to be 20
|
||||
end
|
||||
it "has cards" do
|
||||
expect(first.class).to be Card
|
||||
@ -29,16 +29,16 @@ module Merged
|
||||
end
|
||||
|
||||
it "deletes " do
|
||||
card = Card.find(20)
|
||||
expect(card).not_to be nil
|
||||
card.delete
|
||||
expect{Card.find(20) }.to raise_error(ActiveHash::RecordNotFound)
|
||||
id = first.id
|
||||
first.delete
|
||||
expect{Card.find(id) }.to raise_error(ActiveHash::RecordNotFound)
|
||||
end
|
||||
|
||||
it "destroys " do
|
||||
Card.find(20).destroy
|
||||
id = first.id
|
||||
first.delete
|
||||
Card.reload
|
||||
expect{Card.find(20) }.to raise_error(ActiveHash::RecordNotFound)
|
||||
expect{Card.find(id) }.to raise_error(ActiveHash::RecordNotFound)
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -5,7 +5,7 @@ module Merged
|
||||
let(:index) {Page.find_by_name('index')}
|
||||
|
||||
it "has Pages.all" do
|
||||
expect(Page.all.length).to be 6
|
||||
expect(Page.all.length).to be 2
|
||||
end
|
||||
it "has index page" do
|
||||
expect(index.class).to be Page
|
||||
@ -53,5 +53,9 @@ module Merged
|
||||
page = Page.new_page( name)
|
||||
expect(page.name).to eq name
|
||||
end
|
||||
|
||||
it "has type" do
|
||||
expect(index.type).to eq "page"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -2,12 +2,11 @@ require 'rails_helper'
|
||||
|
||||
module Merged
|
||||
RSpec.describe Section, type: :model do
|
||||
let(:first) {Section.find_by_id(1)}
|
||||
let(:second) {Section.find_by_id(2)}
|
||||
let(:first) {Section.first}
|
||||
let(:last) {Section.last}
|
||||
|
||||
it "has Sections.all" do
|
||||
expect(Section.all.length).to be 40
|
||||
expect(Section.all.length).to be 14
|
||||
end
|
||||
it "has index page" do
|
||||
expect(last.class).to be Section
|
||||
@ -22,8 +21,8 @@ module Merged
|
||||
expect(last.cards.class).to be ActiveHash::Relation
|
||||
end
|
||||
it "has options" do
|
||||
expect(second.options.class).to be Hash
|
||||
expect(second.options.length).to be 6
|
||||
expect(last.options.class).to be Hash
|
||||
expect(first.options.length).to be 4
|
||||
end
|
||||
it "has option_definitions" do
|
||||
expect(last.option_definitions.class).to be Array
|
||||
|
Reference in New Issue
Block a user