Skip to content

Commit

Permalink
Added spec assertions to ensure that child page urls don't regress ei…
Browse files Browse the repository at this point in the history
…ther.
  • Loading branch information
parndt committed Mar 1, 2011
1 parent a5ccf42 commit 875f494
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pages/spec/models/page_spec.rb
Expand Up @@ -84,11 +84,23 @@ def turn_off_marketable_urls
@page.url[:path].should == ["rspec-is-great-for-testing-too"]
end

it "should return its path underneath its parent with marketable urls" do
create_child
@child.url[:id].should be_nil
@child.url[:path].should == [@page.url[:path].first, 'the-child-page']
end

it "should not have a path without marketable urls" do
turn_off_marketable_urls
@page.url[:path].should be_nil
@page.url[:id].should == "rspec-is-great-for-testing-too"
end

it "should not mention its parent without marketable urls" do
create_child
@child.url[:id].should == 'the-child-page'
@child.url[:path].should be_nil
end
end

context "home page" do
Expand Down

0 comments on commit 875f494

Please sign in to comment.