aboutsummaryrefslogtreecommitdiffstats
path: root/spec/requests/blog_categories_spec.rb
blob: d0682b616f209966df473ed6923a6bfd435b3279 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require "spec_helper"

describe "blog categories" do
  before(:all) do
    # destroy all existing (if any) users before creating new one
    Refinery::User.destroy_all
    Factory(:refinery_user)
  end

  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