aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models
diff options
context:
space:
mode:
authorJoe Sak <joe@joesak.com>2011-02-16 00:29:36 -0600
committerJoe Sak <joe@joesak.com>2011-02-16 00:29:36 -0600
commitd5ffea8e887799ccc30d9fa1e0a70b01c232abd0 (patch)
tree39d61bf4aea751f95f0b2d04373da368bc7484ae /spec/models
parentd668800767f112c35135fa1a1eb43907ba13edf9 (diff)
downloadrefinerycms-blog-d5ffea8e887799ccc30d9fa1e0a70b01c232abd0.tar.gz
refinerycms-blog-d5ffea8e887799ccc30d9fa1e0a70b01c232abd0.tar.bz2
refinerycms-blog-d5ffea8e887799ccc30d9fa1e0a70b01c232abd0.zip
test coverage for uncategorized blog posts scope
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/blog_posts_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/blog_posts_spec.rb b/spec/models/blog_posts_spec.rb
index ef9d700..0ef9b0e 100644
--- a/spec/models/blog_posts_spec.rb
+++ b/spec/models/blog_posts_spec.rb
@@ -94,6 +94,18 @@ describe BlogPost do
BlogPost.next(blog_post1).should == [blog_post2]
end
end
+
+ describe "uncategorized scope" do
+ it "returns uncategorized posts if they exist" do
+ uncategorized_blog_post = Factory(:post)
+ categorized_blog_post = Factory(:post)
+
+ categorized_blog_post.categories << Factory(:blog_category)
+
+ BlogPost.uncategorized.should include uncategorized_blog_post
+ BlogPost.uncategorized.should_not include categorized_blog_post
+ end
+ end
describe "#live?" do
it "returns true if post is not in draft and it's published" do