aboutsummaryrefslogtreecommitdiffstats
path: root/spec/helpers/refinery/blog
diff options
context:
space:
mode:
authorUģis Ozols <ugis@ugisozols.com>2013-10-17 21:55:13 -0700
committerUģis Ozols <ugis@ugisozols.com>2013-10-17 21:55:13 -0700
commitfbe605051bc98dc609a0cb3ea01abbec084caa6b (patch)
treec89fe158c82896c58549859ed750b6e9093299c7 /spec/helpers/refinery/blog
parent1ef84a1d5b55304f1a6e365c944ecc1d222ab8e3 (diff)
parentc6f4616844fd2861c95fce383bdaefa1fbc5cf62 (diff)
downloadrefinerycms-blog-fbe605051bc98dc609a0cb3ea01abbec084caa6b.tar.gz
refinerycms-blog-fbe605051bc98dc609a0cb3ea01abbec084caa6b.tar.bz2
refinerycms-blog-fbe605051bc98dc609a0cb3ea01abbec084caa6b.zip
Merge pull request #352 from patrickdavey/restrict_tags_to_live_posts
Restricting tags to live posts
Diffstat (limited to 'spec/helpers/refinery/blog')
-rw-r--r--spec/helpers/refinery/blog/controller_helper_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/helpers/refinery/blog/controller_helper_spec.rb b/spec/helpers/refinery/blog/controller_helper_spec.rb
new file mode 100644
index 0000000..727e8b4
--- /dev/null
+++ b/spec/helpers/refinery/blog/controller_helper_spec.rb
@@ -0,0 +1,25 @@
+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
+ tags.should be_empty
+ end
+ end
+
+ context "with live posts" do
+ let!(:blog_post) { FactoryGirl.create(:blog_post, :tag_list => "first, second" ) }
+
+ it "does not return tags" do
+ tags.should_not be_empty
+ end
+ end
+ end
+ end
+ end
+end