Permalink
Browse files

Add spec for #25.

  • Loading branch information...
1 parent 8f1d4d3 commit 3e0413532aa2947f29a3cac9fa422d9a1b75106e Ryan Bigg committed Mar 16, 2010
Showing with 22 additions and 0 deletions.
  1. +22 −0 spec/models/category_spec.rb
@@ -0,0 +1,22 @@
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+
+describe Category do
+ before do
+ setup_user_base
+ setup_forums
+ end
+
+ subject do
+ Category.first
+ end
+
+ #Regression test for #25.
+ it "should set the category_id to nil on all underling forums when destroyed" do
+ forum = subject.forums.first
+ forum.category_id.should_not be_nil
+ subject.destroy
+ forum.reload
+ forum.category_id.should be_nil
+ end
+
+end

0 comments on commit 3e04135

Please sign in to comment.