If you rename a category, also rename the category definition topic.

This commit is contained in:
Robin Ward
2014-07-18 13:59:54 -04:00
parent 75f6b43e62
commit ffa84d9bb4
2 changed files with 16 additions and 0 deletions
+6
View File
@@ -220,6 +220,12 @@ describe Category do
@category.topics_year.should == 0
end
it "renames the definition when renamed" do
@category.update_attributes(name: 'Troutfishing')
@topic.reload
@topic.title.should =~ /Troutfishing/
end
it "should not set its description topic to auto-close" do
category = Fabricate(:category, name: 'Closing Topics', auto_close_hours: 1)
category.topic.auto_close_at.should be_nil