MINOR: Add test to for blog tag urlsegment generation

This behaviour confused me so adding a test to clarify that it’s
intentional.
This commit is contained in:
Sam Minnee 2017-05-11 12:29:44 +12:00
parent 50d928101c
commit f5c2537c03

View File

@ -203,4 +203,17 @@ class BlogTagTest extends FunctionalTest
$this->assertEquals(BlogTag::DUPLICATE_EXCEPTION, $messages[0]['messageType']); $this->assertEquals(BlogTag::DUPLICATE_EXCEPTION, $messages[0]['messageType']);
} }
} }
public function testBlogTagUrlSegmentsAreAutomaticallyUpdated()
{
$tag = new BlogTag;
$tag->Title = "a test";
$tag->write();
$this->assertEquals($tag->URLSegment, "a-test");
$tag->Title = "another test";
$tag->write();
$this->assertEquals($tag->URLSegment, "another-test");
}
} }