aboutsummaryrefslogtreecommitdiffstats
path: root/spec/requests/blog_categories_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests/blog_categories_spec.rb')
-rw-r--r--spec/requests/blog_categories_spec.rb29
1 files changed, 16 insertions, 13 deletions
diff --git a/spec/requests/blog_categories_spec.rb b/spec/requests/blog_categories_spec.rb
index 8ac6eff..d18a552 100644
--- a/spec/requests/blog_categories_spec.rb
+++ b/spec/requests/blog_categories_spec.rb
@@ -2,19 +2,22 @@ require "spec_helper"
describe "blog categories" do
login_refinery_user
-
- before(:each) do
- @blog_post = Factory(:blog_post, :title => "Refinery CMS blog post")
- @blog_category = Factory(:blog_category, :title => "Video Games")
- @blog_post.categories << @blog_category
- @blog_post.save!
- end
-
- context "has posts" do
- it "displays category's blog posts" do
- visit blog_category_path(@blog_category)
- page.should have_content("Refinery CMS blog post")
- page.should have_content("Video Games")
+
+ context "has one category and post" do
+ before(:each) do
+ @blog_post = Factory.create(:blog_post, :title => "Refinery CMS blog post")
+ @blog_category = Factory.create(:blog_category, :title => "Video Games")
+ @blog_post.categories << @blog_category
+ @blog_post.save!
+ end
+
+ describe "show categories blog posts" do
+ before(:each) { visit blog_category_path(@blog_category) }
+
+ it "should displays categories blog posts" do
+ page.should have_content("Refinery CMS blog post")
+ page.should have_content("Video Games")
+ end
end
end
end