aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/refinery/blog/posts_controller_spec.rb
blob: ee948a5118b8ea75b1efafeff01277907c433e99 (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
require "spec_helper"

module Refinery
  module Blog
    describe PostsController do
      before do
        FactoryGirl.create(:blog_post, :title => "blogpost_one")
        FactoryGirl.create(:blog_post, :title => "blogpost_two")
        FactoryGirl.create(:blog_post, :title => "blogpost_three")
      end

      it "should not limit rss feed" do
        get :index, :format => :rss
        assigns[:posts].size.should == 3
      end

      it "should limit rss feed" do
        get :index, :format => :rss, :max_results => 2
        assigns[:posts].count.should == 2
      end
    end
  end
end