aboutsummaryrefslogtreecommitdiffstats
path: root/spec/requests
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/blog_categories_spec.rb19
-rw-r--r--spec/requests/blog_posts_spec.rb20
2 files changed, 39 insertions, 0 deletions
diff --git a/spec/requests/blog_categories_spec.rb b/spec/requests/blog_categories_spec.rb
new file mode 100644
index 0000000..b98fdf5
--- /dev/null
+++ b/spec/requests/blog_categories_spec.rb
@@ -0,0 +1,19 @@
+require "spec_helper"
+
+describe "blog categories" do
+ 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")
+ end
+ end
+
+end
diff --git a/spec/requests/blog_posts_spec.rb b/spec/requests/blog_posts_spec.rb
new file mode 100644
index 0000000..f89ba9a
--- /dev/null
+++ b/spec/requests/blog_posts_spec.rb
@@ -0,0 +1,20 @@
+require "spec_helper"
+
+describe "blog" do
+ it "displays the blog rss feed" do
+ get blog_rss_feed_path
+ response.should be_success
+ response.content_type.should eq("application/rss+xml")
+ end
+
+ describe "posts" do
+ let!(:blog_post) { Factory(:blog_post, :title => "Refinery CMS blog post") }
+
+ context "has blog posts" do
+ it "Displays blog post" do
+ visit blog_post_path(blog_post)
+ page.should have_content("Refinery CMS blog post")
+ end
+ end
+ end
+end