Skip to content

Commit

Permalink
fixed failing spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew vonderLuft committed Feb 21, 2013
1 parent a69726a commit c8d10fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions spec/controllers/copy_move_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@
end

it "should have copied the descendants" do
assigns[:new_page].should have(3).children
assigns[:new_page].children.first.should have(1).child
assigns[:new_page].should have(pages(:parent).children.count).children
assigns[:new_page].children.descendants.count.should == pages(:parent).children.descendants.count
end

it "should write a flash notice" do
Expand Down
9 changes: 5 additions & 4 deletions spec/models/copy_move_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,19 @@
@new_page = @page.copy_tree_to(pages(:first))
@new_page.parent.should == pages(:first)
@new_page.should have(3).children
@new_page.children.first.should have(1).child
@new_page.children.first.children.first.should have(1).child
@new_page.should have(pages(:parent).children.count).children
@new_page.children.descendants.count.should == pages(:parent).children.descendants.count
end

it "should override the status when given" do
@new_page = @page.copy_tree_to(pages(:first), Status[:hidden].id)
@new_page.status.should == Status[:hidden]
@new_page.children.each do |child|
child.status.should == Status[:hidden]
child.children.each do |grandchild|
grandchild.status.should == Status[:hidden]
end
end
@new_page.children.first.children.first.status.should == Status[:hidden]
@new_page.children.first.children.first.children.first.status.should == Status[:hidden]
end
end
end

0 comments on commit c8d10fc

Please sign in to comment.