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

               
                                               



                                       
                                                                                                            
 
                                      
                                    



                                    
                                                                                            
 

                                        





             
require 'spec_helper'

module Refinery
  module Blog
    describe ControllerHelper, type: :helper 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