aboutsummaryrefslogtreecommitdiffstats
path: root/spec/helpers/refinery/blog/controller_helper_spec.rb
blob: b9aa6a7cb1d378b3971e80251513729fdfec1000 (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
26
27
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