fix all news
This commit is contained in:
@ -23,6 +23,11 @@ module Merged
|
||||
expect(first.next_card.index).to be 2
|
||||
end
|
||||
|
||||
it "create a new" do
|
||||
card = Card.new_card("card_normal_square" , 1 , 1)
|
||||
expect(card.index).to eq 1
|
||||
end
|
||||
|
||||
it "deletes " do
|
||||
card = Card.find(20)
|
||||
expect(card).not_to be nil
|
||||
|
@ -21,32 +21,33 @@ module Merged
|
||||
expect(section.index).to be index + 1 # because we have human index
|
||||
end
|
||||
end
|
||||
|
||||
it "deletes " do
|
||||
id = index.id
|
||||
index.delete
|
||||
expect{Page.find(id) }.to raise_error(ActiveHash::RecordNotFound)
|
||||
end
|
||||
|
||||
it "destroys " do
|
||||
id = index.id
|
||||
index.destroy
|
||||
Section.reload
|
||||
expect{Page.find(id) }.to raise_error(ActiveHash::RecordNotFound)
|
||||
end
|
||||
|
||||
it "destroys sections" do
|
||||
id = index.sections.first.id
|
||||
index.destroy
|
||||
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 section with right index" do
|
||||
should_be = index.sections.last.index + 1
|
||||
s = index.new_section("section_spacer")
|
||||
expect(s.index).to eq should_be
|
||||
end
|
||||
it "creates page" do
|
||||
name = "randomname"
|
||||
page = Page.new_page( name)
|
||||
|
@ -50,6 +50,13 @@ module Merged
|
||||
expect(s.template).to eq "section_spacer"
|
||||
end
|
||||
|
||||
it "creates card with right index" do
|
||||
s = Section.find_by_template("section_cards")
|
||||
length = s.cards.length
|
||||
c = s.new_card
|
||||
expect(c.index).to eq length + 1
|
||||
end
|
||||
|
||||
it "deletes " do
|
||||
last_id = last.id
|
||||
last.delete
|
||||
|
Reference in New Issue
Block a user