diff options
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/blog_categories_spec.rb | 20 | ||||
-rw-r--r-- | spec/models/blog_comments_spec.rb | 20 | ||||
-rw-r--r-- | spec/models/blog_posts_spec.rb | 15 |
3 files changed, 55 insertions, 0 deletions
diff --git a/spec/models/blog_categories_spec.rb b/spec/models/blog_categories_spec.rb new file mode 100644 index 0000000..d97172c --- /dev/null +++ b/spec/models/blog_categories_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe BlogCategory do + context "wiring up" do + + before(:each) do + @category = Factory(:blog_category) + end + + it "saves" do + @category.should_not be_nil + end + + it "has a blog post" do + BlogPost.last.categories.should include(@category) + end + + end + +end
\ No newline at end of file diff --git a/spec/models/blog_comments_spec.rb b/spec/models/blog_comments_spec.rb new file mode 100644 index 0000000..145626d --- /dev/null +++ b/spec/models/blog_comments_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe BlogComment do + + context "wiring up" do + + before(:each) do + @comment = Factory(:blog_comment) + end + + it "saves" do + @comment.should_not be_nil + end + + it "has a blog post" do + @comment.post.should_not be_nil + end + + end +end
\ No newline at end of file diff --git a/spec/models/blog_posts_spec.rb b/spec/models/blog_posts_spec.rb new file mode 100644 index 0000000..a334c73 --- /dev/null +++ b/spec/models/blog_posts_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +describe BlogPost do + context "wiring up" do + + before(:each) do + @post = Factory(:post) + end + + it "saves to the database" do + @post.should_not be_nil + end + + end +end
\ No newline at end of file |