aboutsummaryrefslogblamecommitdiffstats
path: root/spec/helpers/refinery/blog/controller_helper_spec.rb
blob: 732f2bdcb5a8573e17fad04a231910ede34569c7 (plain) (tree)
1
2
3
4
5
6
7
8
9
                     
 






                                       
                                                                                                            
 
                                      
                                    



                                    
                                                                                            
 

                                        





             
require 'spec_helper'

module Refinery
  module Blog
    describe ControllerHelper do
      describe "#find_tags" do
        let(:tags) { helper.find_tags }

        context "with draft posts" do
          let!(:blog_post) { FactoryGirl.create(:blog_post, :draft => true, :tag_list => "first, second" ) }

          it "does not return tags" do
            expect(tags).to be_empty
          end
        end

        context "with live posts" do
          let!(:blog_post) { FactoryGirl.create(:blog_post, :tag_list => "first, second" ) }

          it "does return tags" do
            expect(tags).to_not be_empty
          end
        end
      end
    end
  end
end