Skip to content

Commit a64c7fe

Browse files
committed
[LH345] adding test for removing trailing slash from path
1 parent ac0c0c7 commit a64c7fe

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/unit/models/page_test.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ def test_creating_page_with_reserved_path
4545
assert_valid @page
4646
end
4747

48+
def test_creating_page_with_trailing_slash
49+
@page = Factory.build(:page, :path => "/slashed/")
50+
@page.save
51+
assert_equal @page.path, "/slashed"
52+
53+
@page = Factory.build(:page, :path => "/slashed/loooong/path/")
54+
@page.save
55+
assert_equal @page.path, "/slashed/loooong/path"
56+
end
57+
4858
def test_find_live_by_path
4959
@page = Factory.build(:page, :path => '/foo')
5060
assert_nil Page.find_live_by_path('/foo')

0 commit comments

Comments
 (0)